| re: Capture keyboard input?
There are plenty of legitimate reasons to capture keyboard data. I'm working on a project right now that is a perfect example. I'm working on a point of sale application that uses a barcode scanner that communicates to the OS as a USB keyboard device.
One way to capture keyboard data is to use the Windows API to set a global or application specific keyboard hook. There is nothing hacker-like about this. The API methods required are publicly documented and for good reason.
My problem is that a keyboard hook is not an ideal solution because I can't figure out how to tell which keyboard device is generating the data using this approach. Normal keystrokes coming from the keyboard look just like data coming from the barcode scanner.
Ideally, I'd like a solution that lets me capture data from the scanner and keep the current active application from seeing the data. If I can't accomplish this, scanned barcode data will show up in notepad, word, or whatever application currently is active.
Perhaps there is a way to do this with a global or application specific hook. I'm going to keep researching this. If anyone has experience with this sort of project or any suggestions I'd love to hear them.
|