我在哪里可以获得 HID 设备的结构?
例如:
raw data from a device, using GetRawInputData:
( 0 137 117 0 146 130 24 128 0 )
( 0 137 117 0 146 130 8 128 0 )
/\
at this I can see that || there is being a button released
that means, at the 6-th char at 4-th bit
通过分析原始流,我可以找出按钮、开关和模拟数据在哪里。有没有办法从 Windows 询问这些信息。
我的主要目标是基本上得到结构:
Button - 6th char, 4th bit.
Analog - 2nd char
Switch - 6th char, 0-3th bit.
我找到的唯一解决方案是HID Descriptors
. 但我不确定如何使用它们。阅读文档后,我感觉就像撞到了一堵砖墙。是否有一个很好的例子如何使用它们或更好地描述它们的书。(或者没有描述符的更简单的方法)
我发现HidP_GetButtons
但HidP_GetUsages
仍然不知道如何提取结构(如上所述)。