Mac OS X : KMOD_META not being passed as modi fier in SDL 1.2

Hi all,
I’m trying to detect the MetaKey+Q combination so I can shutdown my SDL
application, but KMOD_META never gets assigned to the Keyboard Modifier
variable, instead it appears to be coming back as a SDLK_LMETA or
SDLK_RMETA, which doesn’t help at all.

Is this a known problem or am I doing something wrong? Do I need to do
anything else for it to pick up the META key as a modifier?

Thanks,

Dominique.

dominique at savagesoftwaresolutions.com wrote:

Hi all,
I’m trying to detect the MetaKey+Q combination so I can shutdown my SDL
application, but KMOD_META never gets assigned to the Keyboard Modifier
variable, instead it appears to be coming back as a SDLK_LMETA or
SDLK_RMETA, which doesn’t help at all.

SDLK_META isn’t a single modifier, but a mask for all meta key modifiers
(i.e. both SDLK_LMETA and SDLK_RMETA). Use it like this:

if (mod & SDLK_META) {
// Either meta key is pressed.
}

if ((mod & SDLK_META) && !(mod & ~SDLK_META)) {
// Either meta key is pressed, and no other modifiers are active.
}–
Rainer Deyke - rainerd at eldwood.com