Type Method

removeMonitor(_:)

Remove the specified event monitor.

Declaration

class func removeMonitor(_ eventMonitor: Any)

Parameters

eventMonitor

The event handler object to remove.

Discussion

You must ensure that eventMonitor is removed only once. Removing the same eventMonitor instance multiple times results in an over-release condition, even in a Garbage Collected environment

See Also

Monitoring Application Events

class func addGlobalMonitorForEvents(matching: NSEvent.EventTypeMask, handler: (NSEvent) -> Void) -> Any?

Installs an event monitor that receives copies of events posted to other applications.

class func addLocalMonitorForEvents(matching: NSEvent.EventTypeMask, handler: (NSEvent) -> NSEvent?) -> Any?

Installs an event monitor that receives copies of events posted to this application before they are dispatched.