Intercept Keyboard in VB?
Hello all,
I am very new to API and hooks so go easy on me please!
I need to be able to intercept the keyboard in any application from VB. I am using a barcode wedge scanner and would like to be able to catch when a barcode is scanned vs. when someone is using the keyboard. To do this I can add a preamble to the barcode. I need to be able to "watch" the keyboard in VB and detect when this "preamble" is pressed and capture the keys that follow it (all numbers). I also need to prevent these keys from being sent to what ever application that has focus. I have looked into keyboard hooks but from what I have read it doesnt look like this is possible in VB alone.
I have also considered making that "preamble" a system hotkey that turns on all the number keys as system hotkeys that point to my app and adding a postamble to the end of the barcode that will disable the numbers as hotkeys. that way I would be able to manipulate the barcode any way I want before sending it out to the program that uses it. I am however concerned that a scanner will "press" the keys for the barcode too rapidly to activate the additional hotkeys in time to catch them. Does anyone have any suggestions?
I would really like to create a hook that would do this if it is possible. Thanks!!!