.net – POS for .NET | Differentiate between (barcode) scanner and keyboard input

barcode-scannernetpoint-of-salewpf

I want to differentiate between (barcode) scanner and keyboard input in an WPF application.
What I need is an event which occurs whenever my scanner is providing data.

In my application there is a special field which will be filled with the input from the scanner. So, if the user has focused an other field I don't want to insert the scanned code in that, but my special field.

First of all I switch the input mode of my scanner (connected by USB) from "keyboard emulation" to "raw". But what do I need to do now?

Best Answer

Scanners that implement OPOS or WEPOS (WEB CONTENT NOT AVAILABLE ANYMORE) have COM and/or .Net components that wrap the drivers for the devices. These components can raise an event when data is scanned. These standards also apply to much more including magnetic stripe readers, scales, cash drawers, change dispensers, and MICR(check) readers.

If an xPOS driver is not provided, you may get a usb/serial port driver. This makes the device look like it is connected via rs232 to windows. Then you can use System.IO.Ports.SerialPort to write a 'scanner' abstraction.

Another option, is just getting a .sys and .h file. Then you are doing some involved PInvoke and possibly some C.

Related Topic