Re: Which keyboard (barcode scanner) did the event come from?
Re: Which keyboard (barcode scanner) did the event come from?
- Subject: Re: Which keyboard (barcode scanner) did the event come from?
- From: Gerd Knops <email@hidden>
- Date: Wed, 11 Feb 2009 10:34:07 -0600
On Feb 10, 2009, at 5:08 PM, Kevin Gessner wrote:
On Feb 9, 2009, at 11:47 PM, Gerd Knops wrote:
Assuming I have two identical USB keyboards (actually barcode
scanners) connected to a mac, is there any way to tell which of
them a keyboard event came from?
[snip]
Is there some way to, say, get a unique USB device ID or something
like that from an NSEvent or a EventRef?
I faced a similar problem a couple months ago, and didn't find any
way to correlate an NSEvent with a keyboard. My solution was to use
Dave Dribin's DDHidLib (http://www.dribin.org/dave/software/). I
listen for the low-level HID event, which is device-specific, then
wait for the next NSEvent to bubble up. It's a bit of housekeeping,
but it has been working well in practice.
Thanks for the pointer! I suspected I'd have to do something like that.
Gerd
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden