Determining which keyboard is sending keystrokes

后端 未结 5 924
梦如初夏
梦如初夏 2021-01-22 12:04

I have 2 keyboards hooked up to my machine (one on PS/2, the other on USB). How would I determine which keyboard is sending the keystrokes in C#?

5条回答
  •  情书的邮戳
    2021-01-22 12:45

    I'm guessing the problem is that when the barcode scanner is used, the number is going into the active field rather than the field for the bar code ID?

    One solution would be to hook the other fields' OnChange events and look for a barcode number inserted in them (via RegEx). If found, move the barcode out of that field and move the value over to the barcode field.

    No device access required, this could even be done on a Javascript-driven web page.

提交回复
热议问题