• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Grabbing key-downs when not front-most app
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Grabbing key-downs when not front-most app (From: Oliver Donald <email@hidden>)

  • Prev by Date: passing reference to reference to variable from ObjC++ to method of C++ class
  • Next by Date: NSColor and spot colors for PDF generation
  • Previous by thread: Grabbing key-downs when not front-most app
  • Next by thread: Re: Threads and UI
  • Index(es):
    • Date
    • Thread