Disabled key-repeats

Hi there, I’ve run across a problem where my key-repeats are getting
disabled after I run my (trival - open a window, blit some rects to it)
SDL-using program.

Is this a known problem? Does anyone have any suggestions as to what might
be happening? Is it likely to be an SDL problem, or could X set up wrong?
I don’t even really know where to start looking…

I’m running Afterstep on a pentium-clone Linux system.

Thanks,
Ben.–
Ben Campbell (Antipodean Straggler)
Programmer, CyberLife Technology Ltd
ben.campbell at cyberlife.co.uk

yeah, what the hell. Why does SDL have to behave in this manner?

ben.campbell at cyberlife.co.uk wrote:

[snip snip, rip rip]

Is this a known problem? Does anyone have any suggestions as to what might
be happening? Is it likely to be an SDL problem, or could X set up wrong?
I don’t even really know where to start looking…

Unfortunately, if you don’t call the SDL_Quit() thing-a-ma-bobber-doo-dad, it
jacks up the X repeat. You re-enable it with “xset r on” or “xset r”. It’s a
big annoyance for me since lots of my shit crashes during development and the
repeat gets all screwed up.

I’m running Afterstep on a pentium-clone Linux system.

d00d, you needz to check out WindowMaker, I found it to be faster / more fun
than Afterstep. However, AS has lots of configuation and customization
options.

Hasta!

Paul Lowe
spazz at ulink.net

Bored? Check out www.fugly.net <- Sophisticated social comedy :slight_smile:

Unfortunately, if you don’t call the SDL_Quit()
thing-a-ma-bobber-doo-dad, it
jacks up the X repeat. You re-enable it with “xset r on” or
"xset r". It’s a
big annoyance for me since lots of my shit crashes during
development and the
repeat gets all screwed up.

Ahhh - so SDL actively turns off key repeats… Sounds fair enough actually

  • if it didn’t do that you’d get zillions of extra keydown events while keys
    were held down.

I can live with it :slight_smile:
Hmmm, maybe I should try and write it up as a FAQ.

d00d, you needz to check out WindowMaker, I found it to be
faster / more fun
than Afterstep. However, AS has lots of configuation and customization
options.

Oooo. Holy war!

Thanks for the help,
Ben.–
Ben Campbell (Antipodean Straggler)
Programmer, CyberLife Technology Ltd
ben.campbell at cyberlife.co.uk

Ahhh - so SDL actively turns off key repeats… Sounds fair enough actually

  • if it didn’t do that you’d get zillions of extra keydown events while keys
    were held down.

Actually, it no longer does this as of 0.9.9.
Check out the latest development build. :slight_smile:

-Sam Lantinga				(slouken at devolution.com)

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

Ahhh - so SDL actively turns off key repeats… Sounds fair enough actually

Actually, it no longer does this as of 0.9.9.

I was running 0.9.9 and it turned off key repeats. Maybe versons
greater than 0.9.9? I upgraded to 0.9.13 and that definitely doesn’t
turn off key repeats. I like my key repeats staying on :^).

I don’t see why youd want that. If you want continuous input about keys from
the user, check the keystate every frame of the program. Taking in keyrepeats
as events can get messy. The key events can pile up in the queue and be
processed a long time after they were actually sent.
In one windows project I decided to try using key repeates and scroll a
map as every key came in through the queue, it resulted in some of the ugliest
choppiest scrolling. The keyrepeats weren’t being sent and processed at equal
intervals. I finally ended up scrolling on a keydown press and then stopped
scrolling on a keyup press. Just my two cents.

-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 Tue, 20 Jul 1999, you wrote:

Ahhh - so SDL actively turns off key repeats… Sounds fair enough actually

Actually, it no longer does this as of 0.9.9.

I was running 0.9.9 and it turned off key repeats. Maybe versons
greater than 0.9.9? I upgraded to 0.9.13 and that definitely doesn’t
turn off key repeats. I like my key repeats staying on :^).

I was running 0.9.9 and it turned off key repeats. Maybe versons
greater than 0.9.9? I upgraded to 0.9.13 and that definitely doesn’t
turn off key repeats. I like my key repeats staying on :^).

I don’t see why youd want that. If you want continuous input about keys from

The SDL game/application isn’t the only thing I’m running on my desktop.
Isn’t it a little rude to turn key repeats off for the entire X display?

My guess is that Sam fixed it so further keys (from key repeats) are
just not passed on to the program, so functionality is the same. IE if a
key is already down and you get a key down event with that keycode, don’t
pass it on.

A problem I had with sdlblomber is that I wanted the ALT keys to be part
of the user input. Under win32 alt has some extra meaning and so key up
events would be lost, ending up with arrow keys stuck down. I changed
the key to ‘b’ instead of ALT, but hitting alt during the game will
still cause the stuck keys. Perhaps the keystate functions are more
accurate as to whether keys are up or down. I’m just keeping a list of
downcodes that have not been canceled by a later upcode.

Oh for the entire display would be a pain… well it doesn’t do that for me
and Im running 9.13

-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 Tue, 20 Jul 1999, you wrote:

I was running 0.9.9 and it turned off key repeats. Maybe versons
greater than 0.9.9? I upgraded to 0.9.13 and that definitely doesn’t
turn off key repeats. I like my key repeats staying on :^).

I don’t see why youd want that. If you want continuous input about keys from

The SDL game/application isn’t the only thing I’m running on my desktop.
Isn’t it a little rude to turn key repeats off for the entire X display?

My guess is that Sam fixed it so further keys (from key repeats) are
just not passed on to the program, so functionality is the same. IE if a
key is already down and you get a key down event with that keycode, don’t
pass it on.

That’s right. In SDL_sysevents.c there is a function called KeyRepeat()
which does exactly this. After getting a KeyRelease event, it peeks the
next event. If it’s a KeyPress with the same keycode and timestamp, both
events are discarded. Like magic. So your program does get the
extranneous events, but SDL discards them before you see them.

A problem I had with sdlblomber is that I wanted the ALT keys to be part
of the user input. Under win32 alt has some extra meaning and so key up
events would be lost,

After two years, I haven’t been able to use the ALT key under Windows.
It’s probably a good idea to stay away from it, so the user can use
Alt-Tab, and Alt-F4 and the such.

It might be possible to take over the keyboard using DirectInput, instead
of relying on key events, but that sounds like more trouble than it’s
worth.

-ChuckOn Tue, 20 Jul 1999, Dave Ashley wrote:

Unfortunately, if you don’t call the SDL_Quit() thing-a-ma-bobber-doo-dad,
it
jacks up the X repeat. You re-enable it with “xset r on” or “xset r”. It’s
a
big annoyance for me since lots of my shit crashes during development and
the
repeat gets all screwed up.

-Unix specific babble below-

What about when you use stdlib.h’s atexit() call with SDL_Quit? When you
recieve a segfault, or a sig15 (the default signal when you kill your app),
does the atexit() function list still execute?

When your program gets a segmentation fault, the kernel obviously kills it
for accessing memory from another process, or unallocated memory. Is that
done with an undocumented (in the GNU manpages) signal, or is it done in
another way?

Michael Labbe - Not the pedophile.______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

Michael Labbe wrote:

Unfortunately, if you don’t call the SDL_Quit() thing-a-ma-bobber-doo-dad,
it
jacks up the X repeat. You re-enable it with “xset r on” or “xset r”. It’s
a
big annoyance for me since lots of my shit crashes during development and
the
repeat gets all screwed up.

-Unix specific babble below-

What about when you use stdlib.h’s atexit() call with SDL_Quit? When you
recieve a segfault, or a sig15 (the default signal when you kill your app),
does the atexit() function list still execute?

When your program gets a segmentation fault, the kernel obviously kills it
for accessing memory from another process, or unallocated memory. Is that
done with an undocumented (in the GNU manpages) signal, or is it done in
another way?

Michael Labbe - Not the pedophile.

Is there any particular reason I got this message 14 times? Did everyone else
get it as much?>


Get Your Private, Free Email at http://www.hotmail.com

Is there any particular reason I got this message 14 times? Did everyone
else
get it as much?

It would seem that hotmail has hiccuped, as I have sent another message to
the mailing list with the same settings, and nothing out of the ordinary has
happened. :frowning:

I genuinely feel bad for spamming a mailing list that I respect. I’ll be
moving to sludge at atdot.org, my real e-mail address, shortly. I should have
known better.______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

Michael Labbe wrote:

Is there any particular reason I got this message 14 times? Did everyone
else
get it as much?

It would seem that hotmail has hiccuped, as I have sent another message to
the mailing list with the same settings, and nothing out of the ordinary has
happened. :frowning:

I genuinely feel bad for spamming a mailing list that I respect. I’ll be
moving to sludge at atdot.org, my real e-mail address, shortly. I should have
known better.

Don’t worry about it. Just one more thing we can blame MicroSoft for. :)>


Get Your Private, Free Email at http://www.hotmail.com

Don’t worry about it. Just one more thing we can blame MicroSoft for. :slight_smile:

I can’t resist but point out the irony of the subject of the message thread.______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com