罗技 USB HID 控制器消息
我有一个罗技游戏控制器(http://www.amazon.com/Logitech-Dual -Action-Game-Pad/dp/B0000ALFCI)。我正在使用 C# 和 Microsoft 的 HID 驱动程序来跟踪按下的按钮。每次按下按钮都会发送一个包含 8 个值的字节数组。问题是我不知道这 8 个值代表什么。下面是一个示例:
0, 128, 126, 127, 130, 24, 24, 0, 4, 252
0, 128, 126, 127, 130, 40, 40, 0, 4, 252
0, 128, 126, 127, 127, 72, 72, 0, 4, 252
0, 128, 126, 127, 127, 136, 136, 0, 4, 252
这些分别是按钮按下 1、2、3、4 的字节数组的值。我看到这些值正在发生变化,但我不确定它们代表什么。我无法找到有关 Microsoft HID 驱动程序的任何规格。有人能指出我正确的方向吗?
I have a Logitech game controller(http://www.amazon.com/Logitech-Dual-Action-Game-Pad/dp/B0000ALFCI). I'm using c# and Microsoft's HID driver to track what buttons are being pressed. Each button press sends a Byte Array that has 8 values. The problems is that I don't know what those 8 value represent. Here is an example:
0, 128, 126, 127, 130, 24, 24, 0, 4, 252
0, 128, 126, 127, 130, 40, 40, 0, 4, 252
0, 128, 126, 127, 127, 72, 72, 0, 4, 252
0, 128, 126, 127, 127, 136, 136, 0, 4, 252
Those are the values of the Byte Array for button press 1, 2, 3, 4 respectively. I see where the values are changing, but I'm unsure what they represent. I'm unable to find any specs on Microsoft HID driver. Can someone point me in the right direction?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能想要使用 USB 流量分析器,例如 http://www.usb-monitor.com/查看输入报告,看看是否能给您带来任何见解。
如果您有耐心,Windows 驱动程序工具包中的 HClient 示例程序几乎包含从任何 HID 设备获取和解压输入报告的所有代码。
这里还有一些指向 Jan Axelson's Lakeview Research(在 hidpage.htm 上)的一些 .Net USB 库的链接,但我无法发布该链接,因为我还没有得到代表。
这些可能会用 C# 而不是 C++ 实现 HClient 中的一些相同代码,尽管我尚未证实这一点。
You might want to use a USB traffic analyzer like http://www.usb-monitor.com/ to take a look at the input reports to see if that gives you any insight.
If you have the patience, the HClient sample program in the Windows Driver Kit has pretty much all the code to get and unpack the input reports from any HID device.
There are also some links here to some .Net USB libaries at Jan Axelson's Lakeview Research (on hidpage.htm), but I can't post that link because I've not got the rep yet.
These might implement some of the same code that is in HClient in C# rather than C++, though I have not confirmed this.