Autorepeat

Speaking of autorepeat, there is an application I’m working on that I’d
like to have keyboard repeat enabled. For this application I don’t care
about down/up state of the keys, I just care about key down events.
It’d be nice to be able to tell SDL not to filter autorepeat events.

Just FYI the project is an in-house animation tool that is used by our
artists here (under win95). To avoid windows programming I wrote it
with DJGPP using 320x200 graphics to $a0000 memory (VGA). So it takes
over the display under win95. Then to make it more windows friendly I
ported it to SDL linux, then recompiled it for win32. It is working
perfectly as far as I can tell, but the key repeats are turned off. The
artist uses the arrow keys to move “sprites” around and they like using
key repeat sometimes.

I can always cook up some autorepeat code I guess…just keep track of
downtime for the last keypress and if it is long enough, start duplicating
the code.

Such a software solution would have the advantage of really being able
to tune key repeat spead and delay. A thing that irks me about the current
PC hardware is you can have a $3000 system that is dependent on a $9.99
keyboard for deciding your key repeat delay and speed. Those things should
be configurable under the OS. What is more intimate than your connection
to your keyboard? Think how many hours a day you spend with your hands all
over it :^).

-Dave

For a smooth scroll you can get the first keydown, then every time you loop
through a frame do a
scrollamount * length of last frame animation
so the longer the time it took to process the last frame the more the screen
will scroll so you get a smooth scrolling. Then stop scrolling when you get a
key up. Problem is this is only good for realtime stuff and can be a waste of
cpu for other programs.

-Garrett, WPI student majoring in Computer Science.

“He who joyfully marches in rank and file has already earned
my contempt. He has been given a large brain by mistake, since
for him the spinal cord would suffice.” -Albert EinsteinOn Fri, 23 Jul 1999, you wrote:

I can always cook up some autorepeat code I guess…just keep track of
downtime for the last keypress and if it is long enough, start duplicating
the code.

Yup, this is the way it is usually done.

Such a software solution would have the advantage of really being able
to tune key repeat spead and delay. A thing that irks me about the current
PC hardware is you can have a $3000 system that is dependent on a $9.99
keyboard for deciding your key repeat delay and speed. Those things should
be configurable under the OS. What is more intimate than your connection
to your keyboard? Think how many hours a day you spend with your hands all
over it :^).

:slight_smile:
-Sam Lantinga (slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec