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?
I’ve discarded my approach to realize this with POS for .NET. It’s almost easier to do it yourself, in so far as you the scanner handling it the only relevant part of the framework you were interested in. Here’s basically what I’m using:
The
class Win32imports the used Win32 API functions and contains some constants used by them: