How can I read barcodes without having the user focus a text box first?

后端 未结 4 1133
栀梦
栀梦 2021-02-14 12:46

I recently acquired a Metrologic Barcode scanner (USB port), as everyone already knows it works as a keyboard emulator out of the box.

How do I configure the scanner and

4条回答
  •  隐瞒了意图╮
    2021-02-14 13:17

    I would guess the easiest way to do this would be to intercept key-presses at a higher level, such as PreviewKeyDown in winforms (or use KeyDown on the form, set KeyPreview to true, and use e.SuppressKeyPress to stop the key going down to the controls). There might be a direct API to the device; there might not.

提交回复
热议问题