Click here to Skip to main content
15,885,757 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,
I have a usb barcode scanner that acts like a keyboard. It easily scans barcodes and if sth like notepad is open, it writes the result like a keyboard.
I want to use it in my financial application that is written in C++. I searched and saw many websites but couldn't find a simple result.
FYI:
1.the barcode scanner just acts like a keyboard, it has no feature to have a virtual com port or sth like that
2.the manufacturer doesn't have any API or SDK to work with it
3.I've tested libusb , usb-hid libraries, raw input, direct input from directx and ... but no success

It seems to be so easy but it's so hard. can you help me the simplest way to read the data from it?
Posted

Yeah, use it as a keyboard. All scanners can be programmed to send out a "end-of-scan" key combination. You would use that to determine when the scan has occurred.

Read the docs for your scanner and you should see how to do this.
 
Share this answer
 
Comments
Member 1981774 19-Nov-13 11:09am    
thanks, guess I implement a key combination for end-of-scan
by which functions should I read like keyboard?
CPallini 19-Nov-13 11:50am    
5.
Sergey Alexandrovich Kryukov 19-Nov-13 13:35pm    
Agree, a 5.
—SA
libusb can work directly with USB HID device. Replace windows HID driver with libusb driver (inf wizard) and work with it directly (receive key buffers).
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900