Odd unicode key behaviour on OS X?

Hi all,
I want to detect when the user of my program hits option-? (META-?) on
Mac OS X. This is the standard OS X key for popping up help.

I am hoping to use the unicode member of the sdl keyboard event
structure to get the key value (as my users have all sorts of
international keyboard settings) to get the ‘?’ character, and to
inspect the modifier with SDL_GetModState() to find if META is being
pressed.

Running checkkeys from the test directory I find that I get the '?'
character if I enter shift-/ on my US keyboard with all combinations of
modifiers except option (META), where I get ‘/’ with the shift and meta
modifiers set.

Is this a bug, or should I be expecting this behaviour?

Thanks,
Fred

Hi all,
I want to detect when the user of my program hits option-? (META-?) on
Mac OS X. This is the standard OS X key for popping up help.

Don’t look at the unicode value, this is just the combination of keypresses
to generate a character.

What you want to check is the actual keysym + modifier.

-Sam Lantinga, Software Engineer, Blizzard Entertainment

Sam Lantinga wrote:

Hi all,
I want to detect when the user of my program hits option-? (META-?) on
Mac OS X. This is the standard OS X key for popping up help.

Don’t look at the unicode value, this is just the combination of keypresses
to generate a character.

What you want to check is the actual keysym + modifier.

If the user hits option-? (i.e. META-SHIFT-/ on a US keyboard) I get
keysym / with META and SHIFT modifiers. In a world with international
keyboards I can’t know that the other shifted symbol on the / key is ?
AFAIK (but this is what I’ve done for the last couple of years).

The unicode value would tell me that ? is pressed for any modifier
combination except META! I don’t know what happens on Linux or Windows
(can anyone check what the checkkeys program in the test directory gives
them for META-? on Linux or Windows?).

Fred