Passing on events and the built-in functions
Passing on events and the built-in functions
- Subject: Passing on events and the built-in functions
- From: Jeffrey Mattox <email@hidden>
- Date: Wed, 12 Feb 2003 16:20:10 -0600
I have installed an event handler to get hot key events (e.g., F5) using:
RegisterEventHotKey( hotKeyCode, modifierKey, gMyHotKeyID,
GetApplicationEventTarget(), 0, &gMyHotKeyRef );
When I get the events, I may or may not pass the events on using:
theResult = CallNextEventHandler( nextHandler, theEvent );
I pass on the event if I don't want to do anything with it, and don't
pass it on if I do.
I get the hot key events just fine, but I'm unable to prevent the
built-in handlers for the hot keys from being invoked, too. For
example, on my keyboard, F14 and F15 control the display brightness.
If I return noErr from my F14 handler and don't pass it on, the
brightness handler still gets triggered.
In the other hand, if I pass on the event immediately and check the
result, the return from CallNextEventHandler() is always
eventNotHandledErr, indicating that the event was not handled, even
though some action was taken (evidenced by a brightness change).
Regardless of the hot key, the return in all cases (for all the hot
keys), is eventNotHandledErr.
So, it makes no difference what I return, or whether or not I pass on
the event, the internal operations are still performed. If I pass on
the event, I cannot determine if an action was taken.
What could I be missing, or is there a better way to do this?
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.