Sign in to follow this  
Chris Oden

SDL_EnableKeyRepeat not doing anything

Recommended Posts

I'm using SDL in a Win32GUI. The documentation states that if I set delay to 0 it would disable key repeating, but it still repeats keys as fast as the frame rate. I've tried different values too of course, but there's no difference at all if I use it or not. It also returns 0 so nothing's wrong there... The different classes is in different source and header files, I poll the event to a global variable in the main loop and then check what type of it event was in each class, if it's SDL_KEYDOWN it checks which key and then do what it's supposed to do. What am I doing wrong?

Share this post


Link to post
Share on other sites
For me, without ever calling SDL_EnableKeyRepeat, SDL won't repeat any keys. Calling SDL_EnableKeyRepeat(0, 0) also does not enable it, infact it really disables it when I had enabled it previously.

So SDL's documentation seems to be correct. Maybe it's because of some side effects in your Win32 GUI app which enables or disables it that makes problems.

Share this post


Link to post
Share on other sites
That makes sense, the Win32 GUI is maybe handling the key input instead of SDL...
I'll experiment a bit, thanks for opening my mind.

(edit)

Hmm... That figures, I'm using DevC++ and I must use either Win32 GUI or Win32 console...

This is midly frustrating, so close but so far, far away. The function that fulfills my every desire is there but there's something interfering that makes it useless. Anyone got a clue on how to fix this?

[Edited by - Chris Oden on January 1, 2008 10:12:56 AM]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this