USB Barcode Scanner

J

Jay

I have a barcode scanner with a USB interface. It acts as a keyboard (ie if I scan a barcode, it is
placed at the text cursor as if I'd typed it on the keyboard).

I'd like to bypass this behaviour so barcodes don't go to the text cursor, but instead go into my C#
programme, even if it doesn't have focus.

How do I do this? I somehow need to re-asign its output to my C# programme.
 
S

Samuel R. Neff

Two possibilities. If the barcode scanner is configurable to the
point where you can prepend any barcodes with a keystroke like
windows-b then you can set up a global hook to listen for this
keystroke and then presumably read the rest of the data.

Or if the barcode scanner manufacturer provides an SDK to interact
with it through another API (not the keyboard) then you can use that
directly (although it ties you to a particular brand).

HTH,

Sam
 
J

Jay

Thanks for your help Samuel,

Isn't there any way to "talk" directly to a USB device, in the same way that you can talk to a
serial-port device. I assumed that since USB is a fairly recent and current standard, there would be
plenty of OS API support for it.

Jay


Two possibilities. If the barcode scanner is configurable to the
point where you can prepend any barcodes with a keystroke like
windows-b then you can set up a global hook to listen for this
keystroke and then presumably read the rest of the data.

Or if the barcode scanner manufacturer provides an SDK to interact
with it through another API (not the keyboard) then you can use that
directly (although it ties you to a particular brand).

HTH,

Sam
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top