In Cocoa, i'm working on an app that can send keyboard events. Using CGEventCreateKeyboardEvent
seems to be the proper way to do this. I found the following code snippet:
CGEventRef push = CGEventCreateKeyboardEvent(NULL, 123, true);
CGEventRef release = CGEventCreateKeyboardEvent(NULL, 123, false);
CGEventPost(kCGHIDEventTap, push);
CGEventPost(kCGHIDEventTap, release);
Which does a 'left arrow' push, then release, only its using the hardcoded value 123. Although I have been looking around, I haven't been able to find any type of lookup for the possible values. Would anyone be able to point me in the right direction?