Carbon Key / Char Codes

dave05
Unregistered
 
Post: #1
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:

Code:
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
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Hex key codes Leroy 7 6,520 Apr 22, 2007 10:12 AM
Last Post: Leroy
  char array versus pointer to string constant question WhatMeWorry 7 7,505 Jan 30, 2007 12:26 PM
Last Post: bronxbomber92
  Killing the char on the end of a char array wyrmmage 3 3,434 Dec 4, 2006 08:55 PM
Last Post: wyrmmage
  two-dimensional dynamic array, const char* adding wyrmmage 2 4,968 Nov 22, 2006 04:53 PM
Last Post: wyrmmage
  What... the... heck? Const Char & Chars. Jones 6 3,622 Jun 12, 2006 03:54 PM
Last Post: akb825