I want to create a global shortcut for my app. I\'ve used the \'cool new way\' of doing this with the addGlobalMonitorForEventsMatchingMask method. The problem is, my events don
addGlobalMonitorForEventsMatchingMask:
is not a suitable replacement for the existing Carbon Hotkey API for all sorts of reasons; it's horribly inefficient, for one. And from the docs:
... you can only observe the event; you cannot modify or otherwise prevent the event from being delivered to its original target application.
and
Key-related events may only be monitored if accessibility is enabled or if your application is trusted for accessibility access
The Hotkey API is still the only way to implement global shortcut in OS X. But unlike many Carbon APIs, the Hotkey API is available to 64-bit apps.
Use the hotkey API, which is meant for this purpose.