getting key codes
getting key codes
- Subject: getting key codes
- From: Jeffrey Mattox <email@hidden>
- Date: Sat, 25 Jan 2003 23:44:03 -0600
I want to register a handler for several of the function keys. I
know the virtual code for Cmd-F10, but how can I find or get the
codes for the other function keys (or any arbitrary key with or
without modifiers)?
Here's the section of code I'm using (lifted from UIElementInspector):
const UInt32 kHotKey = 109; // F10 but, what are the others?
...
EventHotKeyRef gMyHotKeyRef;
EventHotKeyID gMyHotKeyID;
EventHandlerUPP gAppHotKeyFunction;
EventTypeSpec eventType;
gAppHotKeyFunction = NewEventHandlerUPP(HotKeyHandler);
eventType.eventClass = kEventClassKeyboard;
eventType.eventKind = kEventHotKeyPressed;
InstallApplicationEventHandler(gAppHotKeyFunction, 1, &eventType,
NULL, NULL);
gMyHotKeyID.signature = kHotKeyIdentifier;
gMyHotKeyID.id = 1;
RegisterEventHotKey(kHotKey, cmdKey, gMyHotKeyID,
GetApplicationEventTarget(), 0, &gMyHotKeyRef);
...
Jeff
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.