- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在研究一个 HID 报告描述符,我通过修改此处的示例代码来使用它: https://code.msdn.microsoft.com/WudfVhidmini-Sample-b304f83a/sourcecode?fileId=42918&pathId=205101617 (该链接打开queue.cpp文件,这是我的驱动程序的大部分读/写代码和默认的隐藏报告描述符所在的位置)。到目前为止,我的驱动程序中更新的报告描述符是(截至 2015 年 5 月 11 日):
HID_REPORT_DESCRIPTOR G_DefaultReportDescriptor[] = {
0x06, 0x00,0xFF, // (GLOBAL) USAGE_PAGE 0xFF00 Vendor-defined
0x09, 0x01, // (LOCAL) USAGE 0xFF000001
0xA1, 0x01, //(MAIN) COLLECTION 0x01 Application (Usage=0xFF000001: Page=Vendor-defined, Usage=, Type=)
0x85, 0x0F, // (GLOBAL) REPORT_ID 0x0F (15)
0x09, 0x01, // (LOCAL) USAGE 0xFF000001
0x15, 0x00, // (GLOBAL) LOGICAL_MINIMUM 0x00 (0) <-- Redundant: LOGICAL_MINIMUM is already 0
0x26, 0xFF,0x00, // (GLOBAL) LOGICAL_MAXIMUM 0x00FF (255)
0x75, 0x08, //(GLOBAL) REPORT_SIZE 0x08 (8) Number of bits per field
0x96, 0x09, 0x00, //(GLOBAL) REPORT_COUNT 0x0009 (9) Number of fields
0xB1, 0x00, // (MAIN) FEATURE 0x00000000 (9 fields x 8 bits) 0=Data 0=Array 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
0x09, 0x01, // (LOCAL) USAGE 0xFF000001
0x96, 0x01, 0x00, // (GLOBAL) REPORT_COUNT 0x0001 (1) Number of fields
0x81, 0x00, // (MAIN) INPUT 0x00000000 (1 field x 8 bits) 0=Data 0=Array 0=Absolute 0=Ignored 0=Ignored 0=PrefState 0=NoNull
0x09, 0x01, //(LOCAL) USAGE 0xFF000001
0x96, 0x07, 0x00, // (GLOBAL) REPORT_COUNT 0x0007 (7) Number of fields
0x91, 0x00, // (MAIN) OUTPUT 0x00000000 (7 fields x 8 bits) 0=Data 0=Array 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
0xC0, // (MAIN) END_COLLECTION Application
0x05, 0x01, // (GLOBAL) USAGE_PAGE 0x0001 Generic Desktop Page
0x09, 0x02, // (LOCAL) USAGE 0x00010002 Mouse (CA=Application Collection)
0xA1, 0x01, // (MAIN) COLLECTION 0x01 Application (Usage=0x00010002: Page=Generic Desktop Page, Usage=Mouse, Type=CA)
0x09, 0x01, // (LOCAL) USAGE 0x00010001 Pointer (CP=Physical Collection)
0xA1, 0x02, // (MAIN) COLLECTION 0x02 Logical (Usage=0x00010001: Page=Generic Desktop Page, Usage=Pointer, Type=CP) <-- Warning: USAGE type should be CL (Logical)
0x05, 0x0A, // (GLOBAL) USAGE_PAGE 0x000A Ordinal Page
0x09, 0x01, // (LOCAL) USAGE 0x000A0001 Instance 1 (UM=Usage Modifier)
0x85, 0x01, // (GLOBAL) REPORT_ID 0x01 (1)
0xA1, 0x00, // (MAIN) COLLECTION 0x00 Physical (Usage=0x000A0001: Page=Ordinal Page, Usage=Instance 1, Type=UM) <-- Warning: USAGE type should be CP (Physical)
0x05, 0x09, // (GLOBAL) USAGE_PAGE 0x0009 Button Page
0x19, 0x01, // (LOCAL) USAGE_MINIMUM 0x00090001 Button 1 Primary/trigger (MULTI=Selector, On/Off, Momentary, or One Shot)
0x29, 0x03, // (LOCAL) USAGE_MAXIMUM 0x00090003 Button 3 Tertiary (MULTI=Selector, On/Off, Momentary, or One Shot)
0x15, 0x00, // (GLOBAL) LOGICAL_MINIMUM 0x00 (0) <-- Redundant: LOGICAL_MINIMUM is already 0
0x25, 0x01, // (GLOBAL) LOGICAL_MAXIMUM 0x01 (1)
0x75, 0x01, // (GLOBAL) REPORT_SIZE 0x01 (1) Number of bits per field
0x95, 0x03, // (GLOBAL) REPORT_COUNT 0x03 (3) Number of fields
0x81, 0x02, // (MAIN) INPUT 0x00000002 (3 fields x 1 bit) 0=Data 1=Variable 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
0x95, 0x05, // (GLOBAL)REPORT_COUNT 0x05 (5) Number of fields
0x81, 0x03, // (MAIN)INPUT 0x00000003 (5 fields x 1 bit) 1 = Constant 1 = Variable 0 = Absolute 0 = NoWrap 0 = Linear 0 = PrefState 0 = NoNull 0 = NonVolatile 0 = Bitmap
0x05, 0x01, // (GLOBAL)USAGE_PAGE 0x0001 Generic Desktop Page
0x09, 0x30, // (LOCAL)USAGE 0x00010030 X(DV = Dynamic Value)
0x09, 0x31, // (LOCAL)USAGE 0x00010031 Y(DV = Dynamic Value)
0x15, 0x81, // (GLOBAL)LOGICAL_MINIMUM 0x81 (-127)
0x25, 0x7F, // (GLOBAL)LOGICAL_MAXIMUM 0x7F (127)
0x75, 0x08, // (GLOBAL)REPORT_SIZE 0x08 (8) Number of bits per field
0x95, 0x02, // (GLOBAL)REPORT_COUNT 0x02 (2) Number of fields
0x81, 0x06, // (MAIN)INPUT 0x00000006 (2 fields x 8 bits) 0 = Data 1 = Variable 1 = Relative 0 = NoWrap 0 = Linear 0 = PrefState 0 = NoNull 0 = NonVolatile 0 = Bitmap
0xC0, // END_COLLECTION Physical
0x05, 0x0A, // (GLOBAL)USAGE_PAGE 0x000A Ordinal Page
0x09, 0x02, // (LOCAL)USAGE 0x000A0002 Instance 2 (UM = Usage Modifier)
0x85, 0x02, // (GLOBAL)REPORT_ID 0x02 (2)
0xA1, 0x00, // (MAIN)COLLECTION 0x00 Physical(Usage = 0x000A0002: Page = Ordinal Page, Usage = Instance 2, Type = UM) < --Warning: USAGE type should be CP(Physical)
0x05, 0x09, // (GLOBAL)USAGE_PAGE 0x0009 Button Page
0x19, 0x01, // (LOCAL)USAGE_MINIMUM 0x00090001 Button 1 Primary / trigger(MULTI = Selector, On / Off, Momentary, or One Shot)
0x29, 0x03, // (LOCAL)USAGE_MAXIMUM 0x00090003 Button 3 Tertiary(MULTI = Selector, On / Off, Momentary, or One Shot)
0x15, 0x00, // (GLOBAL)LOGICAL_MINIMUM 0x00 (0)
0x25, 0x01, // (GLOBAL)LOGICAL_MAXIMUM 0x01 (1)
0x75, 0x01, // (GLOBAL)REPORT_SIZE 0x01 (1) Number of bits per field
0x95, 0x03, // (GLOBAL)REPORT_COUNT 0x03 (3) Number of fields
0x81, 0x02, // (MAIN)INPUT 0x00000002 (3 fields x 1 bit) 0 = Data 1 = Variable 0 = Absolute 0 = NoWrap 0 = Linear 0 = PrefState 0 = NoNull 0 = NonVolatile 0 = Bitmap
0x95, 0x05, // (GLOBAL)REPORT_COUNT 0x05 (5) Number of fields
0x81, 0x03, // (MAIN)INPUT 0x00000003 (5 fields x 1 bit) 1 = Constant 1 = Variable 0 = Absolute 0 = NoWrap 0 = Linear 0 = PrefState 0 = NoNull 0 = NonVolatile 0 = Bitmap
0x05, 0x01, // (GLOBAL)USAGE_PAGE 0x0001 Generic Desktop Page
0x09, 0x30, // (LOCAL)USAGE 0x00010030 X(DV = Dynamic Value)
0x09, 0x31, // (LOCAL)USAGE 0x00010031 Y(DV = Dynamic Value)
0x15, 0x81, // (GLOBAL)LOGICAL_MINIMUM 0x81 (-127)
0x25, 0x7F, // (GLOBAL)LOGICAL_MAXIMUM 0x7F (127)
0x75, 0x08, // (GLOBAL)REPORT_SIZE 0x08 (8) Number of bits per field
0x95, 0x02, // (GLOBAL)REPORT_COUNT 0x02 (2) Number of fields
0x81, 0x06, // (MAIN)INPUT 0x00000006 (2 fields x 8 bits) 0 = Data 1 = Variable 1 = Relative 0 = NoWrap 0 = Linear 0 = PrefState 0 = NoNull 0 = NonVolatile 0 = Bitmap
0xC0, // END_COLLECTION Physical
0x05, 0x0A, // (GLOBAL)USAGE_PAGE 0x000A Ordinal Page
0x09, 0x03, // (LOCAL)USAGE 0x000A0003 Instance 3 (UM = Usage Modifier)
0x85, 0x03, // (GLOBAL)REPORT_ID 0x03 (3)
0xA1, 0x00, // (MAIN)COLLECTION 0x00 Physical(Usage = 0x000A0003: Page = Ordinal Page, Usage = Instance 3, Type = UM) < --Warning: USAGE type should be CP(Physical)
0x05, 0x09, // (GLOBAL)USAGE_PAGE 0x0009 Button Page
0x19, 0x01, // (LOCAL)USAGE_MINIMUM 0x00090001 Button 1 Primary / trigger(MULTI = Selector, On / Off, Momentary, or One Shot)
0x29, 0x03, // (LOCAL)USAGE_MAXIMUM 0x00090003 Button 3 Tertiary(MULTI = Selector, On / Off, Momentary, or One Shot)
0x15, 0x00, // (GLOBAL)LOGICAL_MINIMUM 0x00 (0)
0x25, 0x01, // (GLOBAL)LOGICAL_MAXIMUM 0x01 (1)
0x75, 0x01, // (GLOBAL)REPORT_SIZE 0x01 (1) Number of bits per field
0x95, 0x03, // (GLOBAL)REPORT_COUNT 0x03 (3) Number of fields
0x81, 0x02, // (MAIN)INPUT 0x00000002 (3 fields x 1 bit) 0 = Data 1 = Variable 0 = Absolute 0 = NoWrap 0 = Linear 0 = PrefState 0 = NoNull 0 = NonVolatile 0 = Bitmap
0x95, 0x05, // (GLOBAL)REPORT_COUNT 0x05 (5) Number of fields
0x81, 0x03, // (MAIN)INPUT 0x00000003 (5 fields x 1 bit) 1 = Constant 1 = Variable 0 = Absolute 0 = NoWrap 0 = Linear 0 = PrefState 0 = NoNull 0 = NonVolatile 0 = Bitmap
0x05, 0x01, // (GLOBAL)USAGE_PAGE 0x0001 Generic Desktop Page
0x09, 0x30, // (LOCAL)USAGE 0x00010030 X(DV = Dynamic Value)
0x09, 0x31, // (LOCAL)USAGE 0x00010031 Y(DV = Dynamic Value)
0x15, 0x81, // (GLOBAL)LOGICAL_MINIMUM 0x81 (-127)
0x25, 0x7F, // (GLOBAL)LOGICAL_MAXIMUM 0x7F (127)
0x75, 0x08, // (GLOBAL)REPORT_SIZE 0x08 (8) Number of bits per field
0x95, 0x02, // (GLOBAL)REPORT_COUNT 0x02 (2) Number of fields
0x81, 0x06, // (MAIN)INPUT 0x00000006 (2 fields x 8 bits) 0 = Data 1 = Variable 1 = Relative 0 = NoWrap 0 = Linear 0 = PrefState 0 = NoNull 0 = NonVolatile 0 = Bitmap
0xC0, // END_COLLECTION Physical
0x05, 0x0A, // (GLOBAL)USAGE_PAGE 0x000A Ordinal Page
0x09, 0x04, // (LOCAL)USAGE 0x000A0004 Instance 4 (UM = Usage Modifier)
0x85, 0x04, // (GLOBAL)REPORT_ID 0x04 (4)
0xA1, 0x00, // (MAIN)COLLECTION 0x00 Physical(Usage = 0x000A0004: Page = Ordinal Page, Usage = Instance 4, Type = UM) < --Warning: USAGE type should be CP(Physical)
0x05, 0x09, // (GLOBAL)USAGE_PAGE 0x0009 Button Page
0x19, 0x01, // (LOCAL)USAGE_MINIMUM 0x00090001 Button 1 Primary / trigger(MULTI = Selector, On / Off, Momentary, or One Shot)
0x29, 0x03, // (LOCAL)USAGE_MAXIMUM 0x00090003 Button 3 Tertiary(MULTI = Selector, On / Off, Momentary, or One Shot)
0x15, 0x00, // (GLOBAL)LOGICAL_MINIMUM 0x00 (0)
0x25, 0x01, // (GLOBAL)LOGICAL_MAXIMUM 0x01 (1)
0x75, 0x01, // (GLOBAL)REPORT_SIZE 0x01 (1) Number of bits per field
0x95, 0x03, // (GLOBAL)REPORT_COUNT 0x03 (3) Number of fields
0x81, 0x02, // (MAIN)INPUT 0x00000002 (3 fields x 1 bit) 0 = Data 1 = Variable 0 = Absolute 0 = NoWrap 0 = Linear 0 = PrefState 0 = NoNull 0 = NonVolatile 0 = Bitmap
0x95, 0x05, // (GLOBAL)REPORT_COUNT 0x05 (5) Number of fields
0x81, 0x03, // (MAIN)INPUT 0x00000003 (5 fields x 1 bit) 1 = Constant 1 = Variable 0 = Absolute 0 = NoWrap 0 = Linear 0 = PrefState 0 = NoNull 0 = NonVolatile 0 = Bitmap
0x05, 0x01, // (GLOBAL)USAGE_PAGE 0x0001 Generic Desktop Page
0x09, 0x30, // (LOCAL)USAGE 0x00010030 X(DV = Dynamic Value)
0x09, 0x31, // (LOCAL)USAGE 0x00010031 Y(DV = Dynamic Value)
0x15, 0x81, // (GLOBAL)LOGICAL_MINIMUM 0x81 (-127)
0x25, 0x7F, // (GLOBAL)LOGICAL_MAXIMUM 0x7F (127)
0x75, 0x08, // (GLOBAL)REPORT_SIZE 0x08 (8) Number of bits per field
0x95, 0x02, // (GLOBAL)REPORT_COUNT 0x02 (2) Number of fields
0x81, 0x06, // (MAIN)INPUT 0x00000006 (2 fields x 8 bits) 0 = Data 1 = Variable 1 = Relative 0 = NoWrap 0 = Linear 0 = PrefState 0 = NoNull 0 = NonVolatile 0 = Bitmap
0xC0, // END_COLLECTION Physical
0xC0, // END_COLLECTION Logical
0xC0, // END_COLLECTION Application
};
这是我当前使用的示例附带的默认报告结构(直到我弄清楚可以在其中更改什么):
typedef struct _HIDMINI_INPUT_REPORT {
UCHAR ReportId;
UCHAR Data;
} HIDMINI_INPUT_REPORT, *PHIDMINI_INPUT_REPORT;
//
// output to device from system
//
typedef struct _HIDMINI_OUTPUT_REPORT {
UCHAR ReportId;
UCHAR Data;
USHORT Pad1;
ULONG Pad2;
} HIDMINI_OUTPUT_REPORT, *PHIDMINI_OUTPUT_REPORT;
我的问题有四:
我需要将 4 个鼠标设备的数据从控件集合(到达鼠标设备注释开始之前的第一个集合)向下传递到鼠标集合中。我将如何编写报告描述符来执行此操作,或者我是否需要代码来执行此操作?
我的报告结构代码如何查找从 Windows.Devices.HumanInterfaceDevice 读取/写入控制结构?
我是否应该像 vmulti 那样发送每个报告描述符(除了在一个循环中全部发送)?
注意:我计划使用 https://msdn.microsoft.com/en-us/library/windows/apps/windows.devices.humaninterfacedevice.aspx从上面定义的 4 个鼠标设备读取/写入的类函数,这就是为什么我要费尽心思去弄清楚这些东西。但 msdn 上的类(class)明确指出我无法直接写入鼠标设备。如果是这样的话,我就不会写在这里了。 如果出现问题:是的,这是关于将输入注入(inject)到鼠标集合中,以便我可以让它们与多鼠标应用程序一起使用。上面指向 WudfVhidmin-Sample 的链接不是我的代码但我用来编写驱动程序的示例。
如果我取出第一个结束集合注释之前的部分,它会创建三个鼠标设备,但仅此而已。
最佳答案
听起来您想要定义一个报告描述符来容纳四个物理鼠标指针(至少这是您问题的一部分?)。 HID 报告描述符规范允许“实例”的概念,因此我认为尝试类似以下报告描述符的内容可能值得研究。 我不知道它在实践中是否有效,但它基于 HID Usage Tables 1.12 specification 中“附录 A.5 控件的多个实例”中的一个(相当不稳定的恕我直言)示例。 。
据我所知,没有办法定义一个实例一次并以某种方式生成四个实例。您似乎必须为每个实例复制报告描述符。
无论如何都值得一试。
以下内容是由我不久前编写的一些代码生成的,名为 hidrdd帮助我解码 HID 报告描述符:
//--------------------------------------------------------------------------------
// Decoded Application Collection
//--------------------------------------------------------------------------------
/*
06 00FF (GLOBAL) USAGE_PAGE 0xFF00 Vendor-defined
09 01 (LOCAL) USAGE 0xFF000001
A1 01 (MAIN) COLLECTION 0x01 Application (Usage=0xFF000001: Page=Vendor-defined, Usage=, Type=)
85 0F (GLOBAL) REPORT_ID 0x0F (15)
09 01 (LOCAL) USAGE 0xFF000001
15 00 (GLOBAL) LOGICAL_MINIMUM 0x00 (0) <-- Redundant: LOGICAL_MINIMUM is already 0
26 FF00 (GLOBAL) LOGICAL_MAXIMUM 0x00FF (255)
75 08 (GLOBAL) REPORT_SIZE 0x08 (8) Number of bits per field
96 0900 (GLOBAL) REPORT_COUNT 0x0009 (9) Number of fields
B1 00 (MAIN) FEATURE 0x00000000 (9 fields x 8 bits) 0=Data 0=Array 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
09 01 (LOCAL) USAGE 0xFF000001
96 0100 (GLOBAL) REPORT_COUNT 0x0001 (1) Number of fields
81 00 (MAIN) INPUT 0x00000000 (1 field x 8 bits) 0=Data 0=Array 0=Absolute 0=Ignored 0=Ignored 0=PrefState 0=NoNull
09 01 (LOCAL) USAGE 0xFF000001
96 0700 (GLOBAL) REPORT_COUNT 0x0007 (7) Number of fields
91 00 (MAIN) OUTPUT 0x00000000 (7 fields x 8 bits) 0=Data 0=Array 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
C0 (MAIN) END_COLLECTION Application
*/
//--------------------------------------------------------------------------------
// Decoded Application Collection
//--------------------------------------------------------------------------------
/*
05 01 (GLOBAL) USAGE_PAGE 0x0001 Generic Desktop Page
09 02 (LOCAL) USAGE 0x00010002 Mouse (CA=Application Collection)
A1 01 (MAIN) COLLECTION 0x01 Application (Usage=0x00010002: Page=Generic Desktop Page, Usage=Mouse, Type=CA)
09 01 (LOCAL) USAGE 0x00010001 Pointer (CP=Physical Collection)
A1 02 (MAIN) COLLECTION 0x02 Logical (Usage=0x00010001: Page=Generic Desktop Page, Usage=Pointer, Type=CP) <-- Warning: USAGE type should be CL (Logical)
05 0A (GLOBAL) USAGE_PAGE 0x000A Ordinal Page
09 01 (LOCAL) USAGE 0x000A0001 Instance 1 (UM=Usage Modifier)
85 01 (GLOBAL) REPORT_ID 0x01 (1)
A1 00 (MAIN) COLLECTION 0x00 Physical (Usage=0x000A0001: Page=Ordinal Page, Usage=Instance 1, Type=UM) <-- Warning: USAGE type should be CP (Physical)
05 09 (GLOBAL) USAGE_PAGE 0x0009 Button Page
19 01 (LOCAL) USAGE_MINIMUM 0x00090001 Button 1 Primary/trigger (MULTI=Selector, On/Off, Momentary, or One Shot)
29 03 (LOCAL) USAGE_MAXIMUM 0x00090003 Button 3 Tertiary (MULTI=Selector, On/Off, Momentary, or One Shot)
15 00 (GLOBAL) LOGICAL_MINIMUM 0x00 (0) <-- Redundant: LOGICAL_MINIMUM is already 0
25 01 (GLOBAL) LOGICAL_MAXIMUM 0x01 (1)
75 01 (GLOBAL) REPORT_SIZE 0x01 (1) Number of bits per field
95 03 (GLOBAL) REPORT_COUNT 0x03 (3) Number of fields
81 02 (MAIN) INPUT 0x00000002 (3 fields x 1 bit) 0=Data 1=Variable 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
95 05 (GLOBAL) REPORT_COUNT 0x05 (5) Number of fields
81 03 (MAIN) INPUT 0x00000003 (5 fields x 1 bit) 1=Constant 1=Variable 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
05 01 (GLOBAL) USAGE_PAGE 0x0001 Generic Desktop Page
09 30 (LOCAL) USAGE 0x00010030 X (DV=Dynamic Value)
09 31 (LOCAL) USAGE 0x00010031 Y (DV=Dynamic Value)
15 81 (GLOBAL) LOGICAL_MINIMUM 0x81 (-127)
25 7F (GLOBAL) LOGICAL_MAXIMUM 0x7F (127)
75 08 (GLOBAL) REPORT_SIZE 0x08 (8) Number of bits per field
95 02 (GLOBAL) REPORT_COUNT 0x02 (2) Number of fields
81 06 (MAIN) INPUT 0x00000006 (2 fields x 8 bits) 0=Data 1=Variable 1=Relative 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
C0 (MAIN) END_COLLECTION Physical
05 0A (GLOBAL) USAGE_PAGE 0x000A Ordinal Page
09 02 (LOCAL) USAGE 0x000A0002 Instance 2 (UM=Usage Modifier)
85 02 (GLOBAL) REPORT_ID 0x02 (2)
A1 00 (MAIN) COLLECTION 0x00 Physical (Usage=0x000A0002: Page=Ordinal Page, Usage=Instance 2, Type=UM) <-- Warning: USAGE type should be CP (Physical)
05 09 (GLOBAL) USAGE_PAGE 0x0009 Button Page
19 01 (LOCAL) USAGE_MINIMUM 0x00090001 Button 1 Primary/trigger (MULTI=Selector, On/Off, Momentary, or One Shot)
29 03 (LOCAL) USAGE_MAXIMUM 0x00090003 Button 3 Tertiary (MULTI=Selector, On/Off, Momentary, or One Shot)
15 00 (GLOBAL) LOGICAL_MINIMUM 0x00 (0)
25 01 (GLOBAL) LOGICAL_MAXIMUM 0x01 (1)
75 01 (GLOBAL) REPORT_SIZE 0x01 (1) Number of bits per field
95 03 (GLOBAL) REPORT_COUNT 0x03 (3) Number of fields
81 02 (MAIN) INPUT 0x00000002 (3 fields x 1 bit) 0=Data 1=Variable 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
95 05 (GLOBAL) REPORT_COUNT 0x05 (5) Number of fields
81 03 (MAIN) INPUT 0x00000003 (5 fields x 1 bit) 1=Constant 1=Variable 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
05 01 (GLOBAL) USAGE_PAGE 0x0001 Generic Desktop Page
09 30 (LOCAL) USAGE 0x00010030 X (DV=Dynamic Value)
09 31 (LOCAL) USAGE 0x00010031 Y (DV=Dynamic Value)
15 81 (GLOBAL) LOGICAL_MINIMUM 0x81 (-127)
25 7F (GLOBAL) LOGICAL_MAXIMUM 0x7F (127)
75 08 (GLOBAL) REPORT_SIZE 0x08 (8) Number of bits per field
95 02 (GLOBAL) REPORT_COUNT 0x02 (2) Number of fields
81 06 (MAIN) INPUT 0x00000006 (2 fields x 8 bits) 0=Data 1=Variable 1=Relative 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
C0 (MAIN) END_COLLECTION Physical
05 0A (GLOBAL) USAGE_PAGE 0x000A Ordinal Page
09 03 (LOCAL) USAGE 0x000A0003 Instance 3 (UM=Usage Modifier)
85 03 (GLOBAL) REPORT_ID 0x03 (3)
A1 00 (MAIN) COLLECTION 0x00 Physical (Usage=0x000A0003: Page=Ordinal Page, Usage=Instance 3, Type=UM) <-- Warning: USAGE type should be CP (Physical)
05 09 (GLOBAL) USAGE_PAGE 0x0009 Button Page
19 01 (LOCAL) USAGE_MINIMUM 0x00090001 Button 1 Primary/trigger (MULTI=Selector, On/Off, Momentary, or One Shot)
29 03 (LOCAL) USAGE_MAXIMUM 0x00090003 Button 3 Tertiary (MULTI=Selector, On/Off, Momentary, or One Shot)
15 00 (GLOBAL) LOGICAL_MINIMUM 0x00 (0)
25 01 (GLOBAL) LOGICAL_MAXIMUM 0x01 (1)
75 01 (GLOBAL) REPORT_SIZE 0x01 (1) Number of bits per field
95 03 (GLOBAL) REPORT_COUNT 0x03 (3) Number of fields
81 02 (MAIN) INPUT 0x00000002 (3 fields x 1 bit) 0=Data 1=Variable 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
95 05 (GLOBAL) REPORT_COUNT 0x05 (5) Number of fields
81 03 (MAIN) INPUT 0x00000003 (5 fields x 1 bit) 1=Constant 1=Variable 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
05 01 (GLOBAL) USAGE_PAGE 0x0001 Generic Desktop Page
09 30 (LOCAL) USAGE 0x00010030 X (DV=Dynamic Value)
09 31 (LOCAL) USAGE 0x00010031 Y (DV=Dynamic Value)
15 81 (GLOBAL) LOGICAL_MINIMUM 0x81 (-127)
25 7F (GLOBAL) LOGICAL_MAXIMUM 0x7F (127)
75 08 (GLOBAL) REPORT_SIZE 0x08 (8) Number of bits per field
95 02 (GLOBAL) REPORT_COUNT 0x02 (2) Number of fields
81 06 (MAIN) INPUT 0x00000006 (2 fields x 8 bits) 0=Data 1=Variable 1=Relative 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
C0 (MAIN) END_COLLECTION Physical
05 0A (GLOBAL) USAGE_PAGE 0x000A Ordinal Page
09 04 (LOCAL) USAGE 0x000A0004 Instance 4 (UM=Usage Modifier)
85 04 (GLOBAL) REPORT_ID 0x04 (4)
A1 00 (MAIN) COLLECTION 0x00 Physical (Usage=0x000A0004: Page=Ordinal Page, Usage=Instance 4, Type=UM) <-- Warning: USAGE type should be CP (Physical)
05 09 (GLOBAL) USAGE_PAGE 0x0009 Button Page
19 01 (LOCAL) USAGE_MINIMUM 0x00090001 Button 1 Primary/trigger (MULTI=Selector, On/Off, Momentary, or One Shot)
29 03 (LOCAL) USAGE_MAXIMUM 0x00090003 Button 3 Tertiary (MULTI=Selector, On/Off, Momentary, or One Shot)
15 00 (GLOBAL) LOGICAL_MINIMUM 0x00 (0)
25 01 (GLOBAL) LOGICAL_MAXIMUM 0x01 (1)
75 01 (GLOBAL) REPORT_SIZE 0x01 (1) Number of bits per field
95 03 (GLOBAL) REPORT_COUNT 0x03 (3) Number of fields
81 02 (MAIN) INPUT 0x00000002 (3 fields x 1 bit) 0=Data 1=Variable 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
95 05 (GLOBAL) REPORT_COUNT 0x05 (5) Number of fields
81 03 (MAIN) INPUT 0x00000003 (5 fields x 1 bit) 1=Constant 1=Variable 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
05 01 (GLOBAL) USAGE_PAGE 0x0001 Generic Desktop Page
09 30 (LOCAL) USAGE 0x00010030 X (DV=Dynamic Value)
09 31 (LOCAL) USAGE 0x00010031 Y (DV=Dynamic Value)
15 81 (GLOBAL) LOGICAL_MINIMUM 0x81 (-127)
25 7F (GLOBAL) LOGICAL_MAXIMUM 0x7F (127)
75 08 (GLOBAL) REPORT_SIZE 0x08 (8) Number of bits per field
95 02 (GLOBAL) REPORT_COUNT 0x02 (2) Number of fields
81 06 (MAIN) INPUT 0x00000006 (2 fields x 8 bits) 0=Data 1=Variable 1=Relative 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
C0 (MAIN) END_COLLECTION Physical
C0 (MAIN) END_COLLECTION Logical
C0 (MAIN) END_COLLECTION Application
这应该对应于 C 声明,例如:
//--------------------------------------------------------------------------------
// Vendor-defined featureReport 0F (Device <-> Host)
//--------------------------------------------------------------------------------
typedef struct
{
uint8_t reportId; // Report ID = 0x0F (15)
uint8_t VEN_VendorDefined[9]; // Value = 0 to 255
} featureReport0F_t;
//--------------------------------------------------------------------------------
// Vendor-defined inputReport 0F (Device --> Host)
//--------------------------------------------------------------------------------
typedef struct
{
uint8_t reportId; // Report ID = 0x0F (15)
uint8_t VEN_VendorDefined; // Value = 0 to 255
} inputReport0F_t;
//--------------------------------------------------------------------------------
// Vendor-defined outputReport 0F (Device <-- Host)
//--------------------------------------------------------------------------------
typedef struct
{
uint8_t reportId; // Report ID = 0x0F (15)
uint8_t VEN_VendorDefined[7]; // Value = 0 to 255
} outputReport0F_t;
//--------------------------------------------------------------------------------
// Button Page inputReport 01 (Device --> Host)
//--------------------------------------------------------------------------------
typedef struct
{
uint8_t reportId; // Report ID = 0x01 (1)
// Collection: Mouse Pointer Instance1
uint8_t BTN_MousePointerInstance1Button1 : 1; // Usage 0x00090001: Button 1 Primary/trigger, Value = 0 to 1
uint8_t BTN_MousePointerInstance1Button2 : 1; // Usage 0x00090002: Button 2 Secondary, Value = 0 to 1
uint8_t BTN_MousePointerInstance1Button3 : 1; // Usage 0x00090003: Button 3 Tertiary, Value = 0 to 1
uint8_t : 1; // Pad
uint8_t : 1; // Pad
uint8_t : 1; // Pad
uint8_t : 1; // Pad
uint8_t : 1; // Pad
int8_t GD_MousePointerInstance1X; // Usage 0x00010030: X, Value = -127 to 127
int8_t GD_MousePointerInstance1Y; // Usage 0x00010031: Y, Value = -127 to 127
} inputReport01_t;
//--------------------------------------------------------------------------------
// Button Page inputReport 02 (Device --> Host)
//--------------------------------------------------------------------------------
typedef struct
{
uint8_t reportId; // Report ID = 0x02 (2)
// Collection: Mouse Pointer Instance2
uint8_t BTN_MousePointerInstance2Button1 : 1; // Usage 0x00090001: Button 1 Primary/trigger, Value = 0 to 1
uint8_t BTN_MousePointerInstance2Button2 : 1; // Usage 0x00090002: Button 2 Secondary, Value = 0 to 1
uint8_t BTN_MousePointerInstance2Button3 : 1; // Usage 0x00090003: Button 3 Tertiary, Value = 0 to 1
uint8_t : 1; // Pad
uint8_t : 1; // Pad
uint8_t : 1; // Pad
uint8_t : 1; // Pad
uint8_t : 1; // Pad
int8_t GD_MousePointerInstance2X; // Usage 0x00010030: X, Value = -127 to 127
int8_t GD_MousePointerInstance2Y; // Usage 0x00010031: Y, Value = -127 to 127
} inputReport02_t;
//--------------------------------------------------------------------------------
// Button Page inputReport 03 (Device --> Host)
//--------------------------------------------------------------------------------
typedef struct
{
uint8_t reportId; // Report ID = 0x03 (3)
// Collection: Mouse Pointer Instance3
uint8_t BTN_MousePointerInstance3Button1 : 1; // Usage 0x00090001: Button 1 Primary/trigger, Value = 0 to 1
uint8_t BTN_MousePointerInstance3Button2 : 1; // Usage 0x00090002: Button 2 Secondary, Value = 0 to 1
uint8_t BTN_MousePointerInstance3Button3 : 1; // Usage 0x00090003: Button 3 Tertiary, Value = 0 to 1
uint8_t : 1; // Pad
uint8_t : 1; // Pad
uint8_t : 1; // Pad
uint8_t : 1; // Pad
uint8_t : 1; // Pad
int8_t GD_MousePointerInstance3X; // Usage 0x00010030: X, Value = -127 to 127
int8_t GD_MousePointerInstance3Y; // Usage 0x00010031: Y, Value = -127 to 127
} inputReport03_t;
//--------------------------------------------------------------------------------
// Button Page inputReport 04 (Device --> Host)
//--------------------------------------------------------------------------------
typedef struct
{
uint8_t reportId; // Report ID = 0x04 (4)
// Collection: Mouse Pointer Instance4
uint8_t BTN_MousePointerInstance4Button1 : 1; // Usage 0x00090001: Button 1 Primary/trigger, Value = 0 to 1
uint8_t BTN_MousePointerInstance4Button2 : 1; // Usage 0x00090002: Button 2 Secondary, Value = 0 to 1
uint8_t BTN_MousePointerInstance4Button3 : 1; // Usage 0x00090003: Button 3 Tertiary, Value = 0 to 1
uint8_t : 1; // Pad
uint8_t : 1; // Pad
uint8_t : 1; // Pad
uint8_t : 1; // Pad
uint8_t : 1; // Pad
int8_t GD_MousePointerInstance4X; // Usage 0x00010030: X, Value = -127 to 127
int8_t GD_MousePointerInstance4Y; // Usage 0x00010031: Y, Value = -127 to 127
} inputReport04_t;
关于c++ - 报告描述符和报告数据结构不正确?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29800881/
#include using namespace std; class C{ private: int value; public: C(){ value = 0;
这个问题已经有答案了: What is the difference between char a[] = ?string?; and char *p = ?string?;? (8 个回答) 已关闭
关闭。此题需要details or clarity 。目前不接受答案。 想要改进这个问题吗?通过 editing this post 添加详细信息并澄清问题. 已关闭 7 年前。 此帖子已于 8 个月
除了调试之外,是否有任何针对 c、c++ 或 c# 的测试工具,其工作原理类似于将独立函数复制粘贴到某个文本框,然后在其他文本框中输入参数? 最佳答案 也许您会考虑单元测试。我推荐你谷歌测试和谷歌模拟
我想在第二台显示器中移动一个窗口 (HWND)。问题是我尝试了很多方法,例如将分辨率加倍或输入负值,但它永远无法将窗口放在我的第二台显示器上。 关于如何在 C/C++/c# 中执行此操作的任何线索 最
我正在寻找 C/C++/C## 中不同类型 DES 的现有实现。我的运行平台是Windows XP/Vista/7。 我正在尝试编写一个 C# 程序,它将使用 DES 算法进行加密和解密。我需要一些实
很难说出这里要问什么。这个问题模棱两可、含糊不清、不完整、过于宽泛或夸夸其谈,无法以目前的形式得到合理的回答。如需帮助澄清此问题以便重新打开,visit the help center . 关闭 1
有没有办法强制将另一个 窗口置于顶部? 不是应用程序的窗口,而是另一个已经在系统上运行的窗口。 (Windows, C/C++/C#) 最佳答案 SetWindowPos(that_window_ha
假设您可以在 C/C++ 或 Csharp 之间做出选择,并且您打算在 Windows 和 Linux 服务器上运行同一服务器的多个实例,那么构建套接字服务器应用程序的最明智选择是什么? 最佳答案 如
你们能告诉我它们之间的区别吗? 顺便问一下,有什么叫C++库或C库的吗? 最佳答案 C++ 标准库 和 C 标准库 是 C++ 和 C 标准定义的库,提供给 C++ 和 C 程序使用。那是那些词的共同
下面的测试代码,我将输出信息放在注释中。我使用的是 gcc 4.8.5 和 Centos 7.2。 #include #include class C { public:
很难说出这里问的是什么。这个问题是含糊的、模糊的、不完整的、过于宽泛的或修辞性的,无法以目前的形式得到合理的回答。如需帮助澄清此问题以便重新打开它,visit the help center 。 已关
我的客户将使用名为 annoucement 的结构/类与客户通信。我想我会用 C++ 编写服务器。会有很多不同的类继承annoucement。我的问题是通过网络将这些类发送给客户端 我想也许我应该使用
我在 C# 中有以下函数: public Matrix ConcatDescriptors(IList> descriptors) { int cols = descriptors[0].Co
我有一个项目要编写一个函数来对某些数据执行某些操作。我可以用 C/C++ 编写代码,但我不想与雇主共享该函数的代码。相反,我只想让他有权在他自己的代码中调用该函数。是否可以?我想到了这两种方法 - 在
我使用的是编写糟糕的第 3 方 (C/C++) Api。我从托管代码(C++/CLI)中使用它。有时会出现“访问冲突错误”。这使整个应用程序崩溃。我知道我无法处理这些错误[如果指针访问非法内存位置等,
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 我们不允许提问寻求书籍、工具、软件库等的推荐。您可以编辑问题,以便用事实和引用来回答。 关闭 7 年前。
已关闭。此问题不符合Stack Overflow guidelines 。目前不接受答案。 要求我们推荐或查找工具、库或最喜欢的场外资源的问题对于 Stack Overflow 来说是偏离主题的,因为
我有一些 C 代码,将使用 P/Invoke 从 C# 调用。我正在尝试为这个 C 函数定义一个 C# 等效项。 SomeData* DoSomething(); struct SomeData {
这个问题已经有答案了: Why are these constructs using pre and post-increment undefined behavior? (14 个回答) 已关闭 6
我是一名优秀的程序员,十分优秀!