键盘隐藏报告

问题描述

在一些 github 项目中,我看到对于 HID 键盘报告,它使用了如下的 python 结构:

        self.state = [ 
               0xA1,# This is an input report
               0x01,# Usage report = Keyboard
               # Bit array for Modifier keys (D7 being the first element,D0 being last)
               [0,# Right GUI - (usually the Windows key) 
                0,# Right ALT
                0,# Right Shift
                0,# Right Control
                0,# Left GUI - (again,usually the Windows key)
                0,# Left ALT
                0,# Left Shift
                0],# Left Control
               0x00,# vendor reserved
               0x00,# Rest is space for 6 keys 
               0x00,0x00,0x00 ]

我对结构中出现的前两个字节,0xA1和0x01有一些疑问,因为带有键盘信息的数据实际上是其余的。

HID 报告是否总是以 0xA1 开头?

如果第二个字节的值(0x01)表示“报告使用情况=键盘”,那么什么值对应一个游戏手柄?

感谢您的帮助。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)