Question

All, Thanks in advance for this. I am currently writing a mini-application for OSX in Objective C which reads from a Card Reader and runs against an API.

The Card Reader acts as a HID Device (i.e. Keyboard) and just types. I have setup Register HotKeys in Objective C to listen to keystrokes (i.e. % symbol to start, and ; to end, plus 0-9 numbers). However this listens on all keyboards, meaning the %, ; and 0-9 Keys are useless.

Is there a way in Objective C that you can determine the keyboard used when registering HotKeys, or some way to make this work?

Cheers, Matt

Was it helpful?

Solution

Your best bet is to use the IOHIDManager APIs [1] and subscribe for events for that device. You can set it up to look for the VendorID or for the ProductID of the device, and then have separate responses for each individual device.

[1] http://developer.apple.com/library/mac/#technotes/tn2187/_index.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top