Looking for a better way to handle keyinput..

Hi there,

So, I am trying to implement a new method of handling KeyInput, do to gamestates and an entity handler.

What I have been using is this:
KeyInput class > KeyPressed(), KeyReleased() …

Game class > init() method > this.addKeyListener(new KeyInput());

How could I add keyinput that picks up key input from each gamestate? (Basically, pick up key input per class that gets rendered.)

Thanks!