views:

35

answers:

1

I have an application that borrows code from the Apple event handling sample. It looks like:

InstallEventHandler(GetEventMonitorTarget(), MonitorHandler, GetEventTypeCount(kEvents), kEvents, 0, &sHandler );

GetEventMonitorTarget() is all about getting events for other applications. But from what I've read the event is sort of forked, sent both to my application and to the target application. Because of that, even if I return noErr from my handler function with the intent to keep the default handler from executing the application still also handles the event.

Is there a way to suppress the default handler, or more specifically, the target application from handling the event?

A: 

If you're trying to make a hot key, make a hot key.

If you're trying to do something else, create an event tap.

Peter Hosey
I"m writing an application that allows me to manipulate the attributes of any given window with specific key and mouse events, and if I handle them I then want to block the application from receiving those events. The event tap API looks like exactly what I'm looking for. Thank you!
cygnl7