In OSX, how to determine which keyboard generated an NSEvent?
问题 I've been trying to determine (from within the event handler) which keyboard triggered the event. I've been using these two posts: http://www.cocoabuilder.com/archive/cocoa/229902-which-keyboard-barcode-scanner-did-the-event-come-from.html http://www.cocoabuilder.com/archive/cocoa/274586-getting-keyboard-type-carbon-vs-cg.html#274586 In the second article, the author successfully separate out his keyboards using a Carbon technique, but attempting the same trick using Cocoa fails. On my own