I'm trying to use the method Gdx.input.isKeyJustPressed() to check if the Android BACK button was just pressed. I don't want to use the Gdx.input.isKeyPressed method to avoid multiple calls. Here is my code:
public void handleInput() {
if(Gdx.input.isKeyJustPressed(Input.Keys.BACK)) {
// show previous screen...
}
}
public void update(float dt) {
handleInput();
}
But unfortunately this doesn't work. Any ideas?
handleInput()
and see if the code is even reached, it's probably not and your missing a call to it somewhere deeper down the line. \$\endgroup\$