Flush Input in Slick

Does anyone know how to flush the input in Slick2D? Say I’m playing my game and I press enter, which does nothing while I’m in game. As soon as I pause it, that enter press get’s registered and selects the first thing in the menu.

I’ve found a pause() and resume() method that completely disables input, but that’s not exactly what I need.

And please don’t suggest libGDX. I know Slick is dying. I don’t really care. I like it.

[quote]Say I’m playing my game and I press enter, which does nothing while I’m in game. As soon as I pause it, that enter press get’s registered and selects the first thing in the menu.
[/quote]
Are you saying this happens already, or that you want this to happen?

If it already happens, then it’s probably a bug with Slick and/or your game’s codebase.

If you want it to happen; then you just need to listen for key events and store them in an array list or something. When the game is paused, fire off all your stored key events, and clear the list for the next time around.

No. That’s what happens. From what I can tell, if you don’t check for a key’s input at the time you press it, and then later you check for it, it’s still going to process it from where you pressed it before and never consumed it.

I haven’t checked how input is implemented in Slick, but I thought maybe there was some input buffer that stores input until it is used.