[gameprogrammer] Re: Key Repeat problem

The flaw with this, as I mentioned, is that if the player holds down a key, then with so many keypress/release events being fired for the duration it is held down, the key might not be marked as being pressed at the time when the keys are being processed in the main game loop.

iirc an average keyboard allows/is able to transmit keypresses for at most 6 or 5 keys at once. That's 6/5 events every few ms although it's very unlikely that more than 2/3 keys will ever be pressed at the same time.
I'm pretty sure java could handle this(or correct me if not). And even if the event wasn't processed immediately after it happens in the main game loop it would be in a few frames, although I still doubt it wouldn't be handled before that. And the player wouldn't notice the difference.
With c++/SDL you also get a plethora of key events every few ms however you can handle all of the events there before you do the drawing, ...


Cheers, Simon.


--------------------- To unsubscribe go to http://gameprogrammer.com/mailinglist.html


Other related posts: