title: LibGDX player movement
body: <p>I'm developing a 2D space shooter game with the player only moving left and right. I've rendered a button on the left and the right side of the screen and constantly check if it's touched. The problem with this is that you have to lift your finger of the button in order to press the button on the other side of the screen. I want the ship to be moving towards the last touched part of the screen(Even when you actually didn't lift the finger of your first-touched button).</p>
  
  <pre><code>    public void keyListener(float delta){
  
      //right movement
      if(Gdx.input.isKeyPressed(Keys.RIGHT) || (Gdx.input.isTouched() &amp;&amp; game.cam.getInputInGameWorld().x &gt;= arrowMoveX - 40) &amp;&amp; !isPlayerHit)
          x+=SPEED*Gdx.graphics.getDeltaTime();
  
  
      //left movement
       if(Gdx.input.isKeyPressed(Keys.LEFT) || (Gdx.input.isTouched() &amp;&amp; game.cam.getInputInGameWorld().x &lt; arrowMoveWhite.getWidth() + 40) &amp;&amp; !isPlayerHit)
          x-=SPEED*Gdx.graphics.getDeltaTime();
  </code></pre>
  
  <p>I've tried puting another if statements in these to check for a second movement, but this way it only works on one direction.
  Can you please help me?</p>