How do I read input from a USB HID device?

梦想的初衷 提交于 2019-12-17 12:40:06

问题


I'm making an application to run in the background on a salespoint to read input from a usb scanner. How can I get the input of the scanner from C#? And can I differentiate between the scanner and a usb keyboard? (Scanner is a HID device)


回答1:


I did this successfully before using a “Raw Input” implementation on CodeProject:

  • Raw Input

It allows you to receive both the input (what “keys” are pressed if it mimics a “keyboard”) as well distinguish which device it came from.



来源:https://stackoverflow.com/questions/3655023/how-do-i-read-input-from-a-usb-hid-device

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!