Hi,
I've developed application which works with clipboard data(text, image etc.)
On pressing "Mac" + "C" handle event in my function. After my logic event should returns to system keyboard chain of events. But it blocks (((
Please help with this issue. Here is a code:
Thank you in advance.
I've developed application which works with clipboard data(text, image etc.)
On pressing "Mac" + "C" handle event in my function. After my logic event should returns to system keyboard chain of events. But it blocks (((
Please help with this issue. Here is a code:
PHP:
OSStatus MyHotKeyHandler(EventHandlerCallRef nextHandler,EventRef theEvent, void *userData)
{
NSLog(@"it works...\n");
UnregisterEventHotKey(gMyHotKeyRef);
SendEventToEventTarget(theEvent, eventTargetRef);
return noErr;
}
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
//Register the Hotkey
EventHotKeyID gMyHotKeyID;
EventTypeSpec eventType;
eventType.eventClass = kEventClassKeyboard;
eventType.eventKind = kEventHotKeyPressed;
InstallApplicationEventHandler(&MyHotKeyHandler,1,&eventType,NULL,NULL);
gMyHotKeyID.signature = 'htk1';
gMyHotKeyID.id = 1;
eventTargetRef = GetApplicationEventTarget();
RegisterEventHotKey(8, cmdKey, gMyHotKeyID, eventTargetRef, 0, &gMyHotKeyRef);
}
Thank you in advance.