[SDL] KeyRepeat fix

David Olofson david at olofson.net
Sun Jan 2 10:22:54 PST 2005


On Sunday 02 January 2005 18.36, Jon Daniel wrote:
> If you switch keys very fast and hold the last one it
> doesn't get repeated because the key release of the first key
> occured after the key press of the second key.
[...]

Might be worth pointing out that that's the way keyboard repeat works 
on most hardware, OSes, GUI toolkits and other places it can be 
implemented. Don't know why, and I consider it an annoying bug. And 
my current desktop, KDE 3.3.0 on XFree86 4.4.0, actually gets it 
right... That's a first for me, I think.

So, I hope this gets included. It makes the built-in repeat a bit more 
useful, I think.


Actually, one might want to go one step further: If key 'A' is 
repeating, one should be able to press 'B' until it starts repeating, 
and when 'B' is released, 'A' should start repeating again. That 
requires a great deal of extra logic, though, and if you really need 
that kind of behavior, you should probably implement your own repeat 
logic anyway. (I would like it if text editors did that with the 
cursor keys, though...)


//David Olofson - Programmer, Composer, Open Source Advocate

.- Audiality -----------------------------------------------.
|  Free/Open Source audio engine for games and multimedia.  |
| MIDI, modular synthesis, real time effects, scripting,... |
`-----------------------------------> http://audiality.org -'
   --- http://olofson.net --- http://www.reologica.se ---




More information about the SDL mailing list