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: Kevin Gessner <email@hidden>
- Date: Wed, 11 Feb 2009 00:08:22 +0100
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.
HTH
-- Kevin
Kevin Gessner
http://kevingessner.com
email@hidden
_______________________________________________
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