Re: "Capturing" a keyboard-like device in a Cocoa application?
Re: "Capturing" a keyboard-like device in a Cocoa application?
- Subject: Re: "Capturing" a keyboard-like device in a Cocoa application?
- From: Kyle Moffett <email@hidden>
- Date: Wed, 16 Apr 2003 00:41:43 -0400
On Tuesday, Apr 15, 2003, at 14:20 US/Eastern, Chris Hanson wrote:
I'm working on a Cocoa desktop application that's Jaguar-only. I'm
running into an issue I think the HID Manager might be able to help me
with. I'm not sure though, so I'd like to get some input from the
community.
In my application, there's a window for user input where the user can
type information in a variety of fields. Some users may also use an
alternative USB input device that emulates a keyboard to enter
information. However, I need to treat input from this alternative
input device specially, and populate particular fields with the input
the device sends.
Specifically: The device sends normal "keystrokes" for user input, and
ends its input with return keystrokes. Some of the keystrokes it
sends should go in some fields, some in other fields, and the returns
it sends should *not* activate the window's default button. But
whenever the user types on an actual keyboard, the input should go
into the field that has the input focus, just like normal, and when
the user presses return or enter on an actual keyboard it should
activate the window's default button, just like normal.
The alternative input devices will all be the same model from the same
manufacturer, so I can hard-code the USB vendor and product ID into my
application if necessary.
Will it be both possible and straightforward to use HID Manager to
somehow "capture" this alternative input device and process its input
specially, and therefore have its input *not* routed through the Cocoa
input mechanism?
Or is there some other technology or mechanism I can use to accomplish
my goal?
This sounds like you'll need to write a KEXT driver for this device.
What device is this? Is there already a Mac OS X driver for it? If
there is not, then you'll need to write one, in the form of a KEXT, and
have it bind to the device using IOKit. Then you can handle the
keystrokes however you want. If there is, that too depends on the
device. Please be more specific.
Cheers,
Kyle Moffett
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCM/CS/IT/U d- s++:- a16 C++++>$ UB/L/X/*++++(+)>$ P+++(++++)>$
L+++(++) E W++(+) N+++(++) o? K? w---(-) O? M++ V? PS+() PE+(-) Y+
PGP? t+(+++) 5 X R? tv-(--) b++++(++) DI+ D+ G e->++++$ h! !r-- !y?
------END GEEK CODE BLOCK------
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.