473,507 Members | 5,257 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.
/Chris
Dec 22 '05 #1
0 4358

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1732
by: Eric Lilja | last post by:
Hello, I have a text file that contains a number of entries describing a recipe. Each entry consists of a number of strings. Here's an example file with only one entry (recipe): Name=Maple Quill...
1
3641
by: Ldaled | last post by:
Okay, I had a previous post called reading an XML document. Since this post I have revised my code and got it to work. Now, Like Derek had mentioned in answer to my previous post, I am getting an...
0
6607
by: rs | last post by:
Hi guys, I am trying to read from a USB keyboard using vb.net and HID classes. the USB keyboard is not my primary keyboard. I have a ps2 keyboard connected and is detected in device manager as...
9
3588
by: Macca | last post by:
Hi, I have a synchronous socket server which my app uses to read data from clients. To test this I have a simulated client that sends 100 byte packets. I have set up the socket server so...
11
3557
by: Freddy Coal | last post by:
Hi, I'm trying to read a binary file of 2411 Bytes, I would like load all the file in a String. I make this function for make that: '-------------------------- Public Shared Function...
6
11877
by: John Wright | last post by:
I am trying to read the data from a device on a serial port. I connect just fine and can receive data fine in text mode but not in binary mode. In text mode the data from the device comes in...
0
1711
by: makTSPL | last post by:
Dear All, I am developing an application in C#. This application communicates with Garmin Forerunner device. I have developed a demo for it, which shows Device software version. but I am not able to...
2
2865
by: Jassim Rahma | last post by:
I have a medical device which has an infrared and i want to know how can i read data from it using the infrared/
9
14350
by: Hal Vaughan | last post by:
I've done a fair amount of Googling for information on reading the serial port in C++ (and in Linux). Unfortunately, out of every 4 hits, 1 seems to be an unanswered question, 1 is someone saying,...
0
7221
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7109
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7313
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7372
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7029
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7481
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5039
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
1
758
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
411
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.