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
}
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.
See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment
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.
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: