Keystrokes lost

Hi!



I'm having problems with keystrokes getting lost.



As far as I can see, LWJGLKeyInput checks if certain keys are pressed once every update.



Could it be that if the duration of time that a key is held down is shorter than the update cycle, there is a possibility that it gets lost?



Or are keystrokes being cached?

Are you talking about this?

http://www.sjbaker.org/wiki/index.php?title=Keyboards_Are_Evil

No, it happens when I press one key at a time.



What I'm wondering is how the keystroke is being detected.  Is it simply checked if it is held down on one occassion in the game loop?



Imagine that it takes 100 ms to render some geometry, and during that time a key is pressed and released, and after that it's time to check if any of the assigned keys are pressed. It will be to late cause the key has already been pressed and released.

The polling of the keyboard is done by lwjgl in the Display.update() iirc, so you might want to look at that and see if it only checks the keyboard at poll or if it gathers them between updates.

If you use the event-based methods in input handler (the ones taking a device name) this should not happen.

Yes, I switched to that and now it doesn't seem to happen anymore.



Thanks!