SDL Keysym question

I’m looking for an alt-x in my event loop. But when ‘x’ is pressed
while ‘alt’ is held down, I get one KEYDOWN event for the ‘alt’ key,
which also has the KMOD_ALT flag set, then another KEYDOWN for the 'x’
key, with no flag set.

Is this the correct behavior?

This is with Linux/SDL, the latest from about a month ago (1.1.x).

Thanks,

– Jeff

I’m looking for an alt-x in my event loop. But when ‘x’ is pressed
while ‘alt’ is held down, I get one KEYDOWN event for the ‘alt’ key,
which also has the KMOD_ALT flag set, then another KEYDOWN for the 'x’
key, with no flag set.
This is with Linux/SDL, the latest from about a month ago (1.1.x).

Hello Jeff,

Under win w/ SDL1.1.1 when pressing ‘left alt’ then ‘x’ then realease both
i first get an SDLK_LALT with NO modifier, then an SDLK_x with KMOD_LALT
modifier. So i think this is the correct behaviour.

code is (in the event loop):

if (event.type == SDL_KEYDOWN) {
fprintf(stderr,“key:%s
modifier:%i\n”,SDL_GetKeyName(event.key.keysym.sym),event.key.keysym.mod);
if (event.key.keysym.sym == SDLK_x && event.key.keysym.mod == KMOD_LALT) {
fprintf(stderr,“ALT+X\n”);
}
}

and stderr is:

key:left alt modifier:0
key:x modifier:256
ALT+X
key:escape modifier:0

Regards,
Dimitris

PS where is 0.27 :wink: