How can I observe the keyboard input event while the application is not activated

how can I watch the keyboard input event while the application is not activated.

+1
source share
1 answer

You need to create a CGEventTap using Quartz Event Services . The user must have access to assistive devices that make sense, because this is the only legitimate reason for this.

If you want to configure a hotkey, there is an API in the Carbon Event Manager , and a Cocoa shell named SGHotKeysLib.Note that the Carbon Event Manager hotkey API is still supported in the current 64-bit Mac OS X.

+3
source

Source: https://habr.com/ru/post/987457/


All Articles