Installs an event monitor that receives copies of events posted to this application before they are dispatched.
- macOS 10.6+
An event mask specifying which events you wish to monitor. See
NSEventfor possible values.
.Event Type Mask
The event handler block object. It is passed the event to monitor. You can return the event unmodified, create and return a new NSEvent object, or return nil to stop the dispatching of the event.
An event handler object.
Your handler will not be called for events that are consumed by nested event-tracking loops such as control tracking, menu tracking, or window dragging; only events that are dispatched through the applications
send method will be passed to your handler.
In OS X v 10.6, event monitors are only able to monitor the following event types: