List of usage examples for com.badlogic.gdx Input isKeyJustPressed
public boolean isKeyJustPressed(int key);
From source file:de.cubicvoxel.openspacebox.input.KeyboardInputHandler.java
License:Open Source License
@Override void handleInput(float deltaTime) { Input input = Gdx.input; float x = 0, y = 0; if (input.isKeyPressed(Input.Keys.A)) x -= 1.0f;/*from w w w .j a v a2 s .co m*/ if (input.isKeyPressed(Input.Keys.D)) x += 1.0f; if (input.isKeyPressed(Input.Keys.W)) y += 1.0f; if (input.isKeyPressed(Input.Keys.S)) y -= 1.0f; if (x != 0 || y != 0) postMoveInputEventWithClampedInput(x, y, deltaTime); if (input.isKeyJustPressed(Input.Keys.BACKSPACE)) inputEventBus.post(new BackInputEvent(deltaTime)); }