views:

36

answers:

1

how do I observe keyboard input event while the applicaion is not actived.

+2  A: 

You'll need to create a CGEventTap using Quartz Event Services. The user must have access for assistive devices turned on, which makes sense, because that's the only legitimate reason for you to do that.

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

Peter Hosey
`Carbon` ? is there new api sets in leapord
xhan
Carbon dates back to 10.0, as noted in the documentation. Most of it is deprecated and/or unavailable now, but some parts are not, and the Carbon Event Manager hotkey API is one of the parts that are still available and supported.
Peter Hosey