usb鼠标可以用,加个自定义的hid设备就出错?
报告描述符如下,求解。0x05, 0x01, // USAGE_PAGE (Generic Desktop) 2
0x09, 0x02, // USAGE (Mouse) 4
0xa1, 0x01, // COLLECTION (Application) 6
0x85, REPORTID_MOUSE, // REPORT_ID (Mouse) 8
0x09, 0x01, // USAGE (Pointer) 10
0xa1, 0x00, // COLLECTION (Physical) 12
0x05, 0x09, // USAGE_PAGE (Button) 14
0x19, 0x01, // USAGE_MINIMUM (Button 1) 16
0x29, 0x02, // USAGE_MAXIMUM (Button 2) 18
0x15, 0x00, // LOGICAL_MINIMUM (0) 20
0x25, 0x01, // LOGICAL_MAXIMUM (1) 22
0x75, 0x01, // REPORT_SIZE (1) 24
0x95, 0x01, // REPORT_COUNT (1) 26
0x81, 0x02, // INPUT (Data,Var,Abs) 28
0x95, 0x07, // REPORT_COUNT (7) 30
0x81, 0x03, // INPUT (Cnst,Var,Abs) 32 一个字节,位1表示左按键的状态
0x05, 0x01, // USAGE_PAGE (Generic Desktop) 34
0x09, 0x30, // USAGE (X) 36
0x09, 0x31, // USAGE (Y) 38
0x75, 0x10, // REPORT_SIZE (16) 40
0x95, 0x02, // REPORT_COUNT (2) 42
0x15, 0x00, // LOGICAL_MINIMUM (0) 44
0x26, 0xff, 0x0f, // LOGICAL_MAXIMUM (4095) 47
0x81, 0x02, // INPUT (Data,Var,Abs) 49 4个字节,分别表示x,y移位大小
0xc0, // END_COLLECTION 50
0xc0, // END_COLLECTION 51
0x05, 0x01, // USAGE_PAGE (Generic) 2
0x09, 0x00, // USAGE 自定义 4
0xa1, 0x01, // COLLECTION (Application) 6
0x85, REPORTID_DEBUG, // REPORT_ID () 8
0x09, 0x01, // USAGE 1 10
0x15, 0x00, // LOGICAL_MINIMUM 12
0x25, 0xff, // LOGICAL_MAXIMUM 14
0x75, 0x08, // REPORT_SIZE 16
0x95, 0x03, // REPORT_COUNT 18
0x81, 0x02, // INPUT 20 3个字节,作为调试用
0x09, 0x02, // USAGE 2 22
0x15, 0x00, // LOGICAL_MINIMUM 24
0x25, 0xff, // LOGICAL_MAXIMUM 26
0x75, 0x08, // REPORT_SIZE 28
0x95, 0x02, // REPORT_COUNT 30
0x91, 0x02, // OUTPUT 32
0xc0 // END_COLLECTION 33 在线等,
之前还有段别的,也可以用的,后来去掉就不行了,好不理解 自定义中的0x09, 0x02, // USAGE 2 22出错了,02表示鼠标,鼠标是没有输出的
好久的贴了,已经弄好了,谢谢了
页:
[1]