Keyboard Bug with SDLK_UP and 2 others keys?

Hi,

I did find a problem with SDLK_UP and OpenGL.

If you push at the same time (about 5 seconds):
SDLK_UP/SDLK_RIGHT/SDLK_LEFT, you will loose some frame, but with:
SDLK_DOWN/SDLK_RIGHT/SDLK_LEFT or others keys, this problem will not be !!
I think SDLK_UP is broken

I saw this problem with other games like: Demonstar, Ultimate Steroids,
Moral Minus, etc…

I give you a part about my code:----------

keys = SDL_GetKeyState(NULL);

if(keys[SDLK_UP] == SDL_PRESSED)
{
// move a cube
goto left_right; //(do not check SDLK_DOWN if SDLK_UP = TRUE)
}

if(keys[SDLK_DOWN] == SDL_PRESSED)
{
// move a cube
}

left_right:

if(keys[SDLK_LEFT] == SDL_PRESSED)
{
// move a cube
goto end; //(do not check SDLK_RIGHT if SDLK_LEFT = TRUE)
}

if(keys[SDLK_RIGHT] == SDL_PRESSED)
{
// move a cube
}

end:


Please tell me what can I do ?

Laurent (France)


Rejoignez MSN Hotmail, le plus important service de messagerie
http://www.hotmail.com/fr

Hi,

I did find a problem with SDLK_UP and OpenGL.

If you push at the same time (about 5 seconds):
SDLK_UP/SDLK_RIGHT/SDLK_LEFT, you will loose some frame, but with:
SDLK_DOWN/SDLK_RIGHT/SDLK_LEFT or others keys, this problem will not be !!
I think SDLK_UP is broken

It actually sounds like a limitation of your keyboard. Many keyboards
support pressing some combinations of keys together but not other combinations.
It may be that your keyboard is emulating multiple key press in that situation
by spamming the operating system with keyboard interrupts, which might cause
framerate reduction.

That’s my theory, anyway. :slight_smile:

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

Hi,

I did find a problem with SDLK_UP and OpenGL.

If you push at the same time (about 5 seconds):
SDLK_UP/SDLK_RIGHT/SDLK_LEFT, you will loose some frame, but with:
SDLK_DOWN/SDLK_RIGHT/SDLK_LEFT or others keys, this problem will not be !!
I think SDLK_UP is broken

It actually sounds like a limitation of your keyboard. Many keyboards
support pressing some combinations of keys together but not other combinations.
It may be that your keyboard is emulating multiple key press in that situation
by spamming the operating system with keyboard interrupts, which might cause
framerate reduction.

That’s my theory, anyway. :slight_smile:

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

Just my 2 cents here, but I think Sam is right. I remember exactly this
happening back in the DOS days when I was writing a handler for the
keyboard.

My keyboard back in the day would allow 3 keys at once, the fourth would
’unpress’ the first three and start repeating on the fourth, then no
further presses would be accepted until all of the originals were
released.On Mon, 2002-09-16 at 04:48, Sam Lantinga wrote:


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

End of Rant.

Jimmy
Jimmy’s World (http://www.jimmysworld.org)
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20020916/d8747572/attachment.pgp