Howdy
Immediately after calling Display.update(), I use
while( Keyboard.next() )
{
int key = Keyboard.getEventKey();
boolean down = Keyboard.getEventKeyState();
boolean repeat = Keyboard.isRepeatEvent();
for( int j = 0; j < keyListeners.size(); j++ )
{
if( down )
keyListeners.get( j ).keyDown( key, repeat );
else
keyListeners.get( j ).keyUp( key );
}
}
to process pending key events. The problem is that there are occasional erroneous events. When holding down “W”, for example, i get something like:
Down W at 2.517
Up W at 5.621
Down W at 5.621
Up W at 6.358
Down W at 6.358
Up W at 9.075
Down W at 9.075
Up W at 11.39
Down W at 11.39
Up W at 20.246
Down W at 20.246
Up W at 33.866
Down W at 33.866
Up W at 35.208
Down W at 35.208
Up W at 35.275
The KeyboardTest does not exhibit this behaviour, so PEBKAC applies, but I haven’t the foggiest what I could be doing to cause this behaviour.
I did find a similar case on the LWJGL forums, but he was doing multithreaded stuff, which I am not.
This is running on Linux, by the way
Has anyone seen anything similar?
Great stuff