I'm trying to figure it out how to check if keyboard key was released. I tried messing around with InputMultiplexer, InputProcessor, etc. Nothing helped. Not enough documentation from lib developers (at least for me).

Anyone had similar problem? Can someone help me?

With InputProcessor I can check if single key was pressed. But what if I want to check multiple keys?


1 Answer 1


There are two ways I can think of to accomplish this.

  1. In the InputProcessor keyPressed method you could save the key state in a map. You'll have to use the keyReleased method to set the key state to released. This way you can just check the map to make sure the right keys are pressed.

  2. Inside your update/render method call Gdx.input.isKeyPressed(Input.Keys.Key) to see if a key is pressed. This way you are polling input every frame to check for the key combination.

I personally would use method 2, but pick whatever will suit your app best. I might be able to expand on my answer more tomorrow when I'm on my Desktop. Hopefully for now this will get you going in the right direction.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .