有没有办法将 USB HID 使用 ID 转换为 Windows 操作系统中的虚拟按键代码?
例如,
HID Usage ID 0x04 ---> Virtual Key is 0x41 (this is key A)
HID Usage ID 0x91 ---> Virtual Key is 0xE9(这是 OEM 特定的 key )
HID Usage ID 0x87 ---> Virtual Key is 0xC1 (this is a Reserved key code)
...
我刚找到一个 virtual keys code table , 但我找不到翻译表或有效翻译它的方法。
最佳答案
没有 API 可以在 HID 使用 ID 和虚拟键码之间进行转换。翻译由设备驱动程序执行。
键盘的使用 ID 发布于 http://usb.org在HID Usage Tables规范(第 10 章“键盘/键盘页面(0x07)”)。
关于windows - 如何在 Windows 操作系统中将 HID 使用 ID 转换为虚拟键码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33610124/