Re: Grabbing key-downs when not front-most app
Re: Grabbing key-downs when not front-most app
- Subject: Re: Grabbing key-downs when not front-most app
- From: Tomas Zahradnicky <email@hidden>
- Date: Thu, 11 Dec 2003 11:53:34 +0100
Hi
I'm writing a background 'menu-extra' application that needs to respond to
keys pressed. It doesn't need to intercept keystrokes or block them, and it
doesn't need to know about modifier/function keys, it simply needs to know
when alphanumeric and punctuation keys are pressed and what they are.
Can anyone tell me a simple method to record keystrokes, or point me in the
right direction?
I am hoping there is a notification I can register for, but I can't find a
likely candidate. I have also searched on the list via Mamasam, but could
only find answers to questions about hotkeys and foreground applications.
Thanks,
Oli
PS No, it isn't a keylogger!
Sorry for non-cocoa reply, but look for GetEventMonitorTarget()
function in HIToolbox/CarbonEvents.h. This function is present since
10.3 and allows you do receive input events for any application.
However you need "Enable access for assistive devices" turned on.
Other way is to do it at HID level (no you don't need to be kext to do it).
-Tomas
--
Ing. Tomas Zahradnicky, Jr.
Production Manager, 24U Software
Associate Member, Filemaker Solutions Alliance
mailto:email@hidden
http://www.24uSoftware.com
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.