Registration failed, check your inHotKeyModifiers parameter
UInt32 keyCode = kVK_ANSI_Keypad1;
EventHotKeyID gMyHotKeyID;
gMyHotKeyID.signature = (FourCharCode)'1234';
gMyHotKeyID.id = 1;
EventHotKeyRef hotKeyRef;
OSStatus status = RegisterEventHotKey(keyCode, cmdKey, gMyHotKeyID, GetApplicationEventTarget(), 0, &hotKeyRef);
if (status == noErr) {
NSLog(@"success!");
} else {
NSLog(@"fail:%d", status);
}
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: