• 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: Which keyboard (barcode scanner) did the event come from?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Which keyboard (barcode scanner) did the event come from?
      • From: Gerd Knops <email@hidden>
References: 
 >Which keyboard (barcode scanner) did the event come from? (From: Gerd Knops <email@hidden>)

  • Prev by Date: Re: High-quality image upscaling
  • Next by Date: Re: One Shot Windows: WARNING
  • Previous by thread: Which keyboard (barcode scanner) did the event come from?
  • Next by thread: Re: Which keyboard (barcode scanner) did the event come from?
  • Index(es):
    • Date
    • Thread