471,325 Members | 1,496 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,325 software developers and data experts.

Reading data from USB device

I am writing a WinForms app that will integrate a handheld voting device
system into the app.
The handhelds communicate to the PC via a USB connection. The USB device has
no manufacturer driver, it simply uses the built in MS HID srv driver. It
sends the results as keyboard commands.
I have 2 ways to catch this data as I see it:
1) I can read the keyboard commands as they come in. In order to make sure
that I get the commands even when my app doesn't have focus, I have written
a Keyboard Hook so that I can catch all of the raw keyboard events coming
in. The problem with this method is that pressing the key on a keypad once
sends in 8 kb events (header, pad#, button signal, button#) x 2 (once for
keyup and once for keydown). Since it is on the same stack as all the other
keyboard events, I can't guarantee those keys will come sequentially.
2) The second option could be to enumerate the USB devices on the machine,
find the voter hardware and bind to it and somehow receive the commands only
from this device.

Does anyone have an idea how I can attach to that device? If I could filter
only keyboard commands coming from the device itself, it would seem to solve
my issue.
Any help would be appreciated.
Dec 22 '05 #1
0 3955

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by Freddy Coal | last post: by
6 posts views Thread by John Wright | last post: by
2 posts views Thread by Jassim Rahma | last post: by
9 posts views Thread by Hal Vaughan | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.