0
votes

I've this problem to solve with an USB device:

  • connected to POS PC (Windows POSReady 2009) there is a USB Keyboard and a USB Dallas I-Button reader
  • USB Reader is connected to MoBo USB bus, and shows up as USB Composite device:

    USB Composite Device USB\VID_134B&PID_0206&REV_0100

    Compatible HID device HID\VID_134B&PID_0206&REV_0100&MI_01

    USB input device (1st instance) USB\VID_134B&PID_0206&REV_0100&MI_00

    USB input device (2st instance) USB\VID_134B&PID_0206&REV_0100&MI_01

    HID Keyboard HID\VID_134B&PID_0206&REV_0100&MI_00

  • when I read I-Button with reader, the code inside the button is added to keyboard buffer (as it was typed with physical keyboard) and active application (wich has keyboard focus) receive the code

  • my application must interract with codes readed by the USB device, however I have to have focus costantly on a TextBox to receive the code
  • this not always is possible, specially with unattended MessageBoxes, wich takes focus (and keyboard input) and can create malfunctions
  • best of all should be having a reader on serial port, or TCP/IP, but this is the only one choice we have (we cannot change reader)

So, my idea is to trap incoming "keypress" from reader keyboard, avoid append in system keyboard buffer, and pass them to my application via WM_USER, WM_COPYDATA, Socket or other method.

So, the goal would be to write a driver, to apply ONLY to specific USB HID device (the I-Button reader, but NOT to the real PC keyboard) who block keypress and send to application in some way.

I checked for the "keyboard filter" Microsoft way, but I can block only some combinations of keys, but this is not my goal.

I think I should create a custom of personal "kbdhid.sys" and/or "kbdcalss.sys" driver and apply ONLY to my USB HID Reader.

Could someone point me out the right direction?

Thanks a lot

1

1 Answers

0
votes

set your reader to send a prefix before sending the code monitor the keyboard que for the prefix and have your application popup so it receives keyboard input.

however many readers can only be set to send a control code like STX - witch is control_B - and in use by windows.