PDA

View Full Version : Carbon Key / Char Codes


dave05
2005.09.25, 12:41 PM
Just in case anyone other than me still uses carbon events rather than NSevents (I plan to make the change soon-ish), here's how I figured out character codes for non-ascii characters:

the user presses a key, then:

GetEventParameter(event,
kEventParamKeyMacCharCodes,
typeChar, nil,
sizeof(charCode), nil,
&charCode);

printf("%d\n", (int)charCode);


if anyone's interested, here are a few:

#define key_UpArrow 30
#define key_DownArrow 31
#define key_LeftArrow 28
#define key_RightArrow 29
#define key_ForwardDelete 127