• 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: 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


References: 
 >Which keyboard (barcode scanner) did the event come from? (From: Gerd Knops <email@hidden>)
 >Re: Which keyboard (barcode scanner) did the event come from? (From: Kevin Gessner <email@hidden>)

  • Prev by Date: Re: Communication between objects
  • Next by Date: Re: UIScrollView - photo viewer like usage
  • Previous by thread: Re: Which keyboard (barcode scanner) did the event come from?
  • Next by thread: NSSavePanel setMessage and line wrapping
  • Index(es):
    • Date
    • Thread