Key Modifier State in Quake1 SDL Port

In the SDL port of Quake1, vid_sdl.c lines 203-5:

            sym = event.key.keysym.sym;
            state = event.key.state;
            modstate = SDL_GetModState();

Why is the modstate explicitly queried? Can’t it use
event.key.keysym.mod? Does the above code guarantee that the modifiers
returned are the same as when the key event was generated?–
Marc Lepage
Software Developer
Molecular Mining Corporation
http://www.molecularmining.com/

In the SDL port of Quake1, vid_sdl.c lines 203-5:

            sym = event.key.keysym.sym;
            state = event.key.state;
            modstate = SDL_GetModState();

Why is the modstate explicitly queried? Can’t it use
event.key.keysym.mod? Does the above code guarantee that the modifiers
returned are the same as when the key event was generated?

Um, I forgot the modifier was in the keysym. :slight_smile:

Thanks!
-Sam Lantinga (slouken at devolution.com)

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

Sam Lantinga wrote:

Um, I forgot the modifier was in the keysym. :slight_smile:

Next question: why does the “SCROL” in “SCROLLOCK” have only one ‘L’?

/* Key state modifier keys */
SDLK_NUMLOCK		= 300,
SDLK_CAPSLOCK		= 301,
SDLK_SCROLLOCK		= 302,-- 

Marc Lepage
Software Developer
Molecular Mining Corporation
http://www.molecularmining.com/