0x05,0x01, /*USAGE_PAGE (Generic Desktop)*/
0x09,0x02, /*USAGE (Mouse)*/
0xa1,0x01, /*COLLECTION (Application)*/
0x09,0x01, /*USAGE (Pointer)*/
0xa1,0x00, /*COLLECTION (Physical)*/
0x85,0x02, /*report ID */
0x05,0x09, /*USAGE_PAGE (Button)*/
0x19,0x01, /*USAGE_MINIMUM (Button 1)*/
0x29,0x03, /*USAGE_MAXIMUM (Button 3)*/
0x15,0x00, /*LOGICAL_MINIMUM (0)*/
0x25,0x01, /*LOGICAL_MAXIMUM (1)*/
0x95,0x03, /*REPORT_COUNT (3)*/
0x75,0x01, /*REPORT_SIZE (1)*/
0x81,0x02, /*INPUT (Data,Var,Abs)*/
0x95,0x01, /*REPORT_COUNT (1)*/
0x75,0x05, /*REPORT_SIZE (5)*/
0x81,0x03, /*INPUT (Cnst,Var,Abs)*/
0x05,0x01, /*USAGE_PAGE (Generic Desktop)*/
0x09,0x30, /*USAGE (X)*/
0x09,0x31, /*USAGE (Y)*/
0x16,0x01,0x80, /*LOGICAL_MINIMUM (-32767)*/
0x26,0xFF,0x7F, /*LOGICAL_MAXIMUM (32767)*/
0x75,0x10, /*REPORT_SIZE (16)*/
0x95,0x02, /*REPORT_COUNT (2)*/
0x81,0x06, /*INPUT (Data,Var,Rel)*/
根据以上判断,发送的data应该是6个byte, 1byte ID+ 1byte(3bit button + 5bit input) + 2byte X + 2byte Y
data[0] = 0x2; 必须
data[1] = 0x1; 为鼠标左键按下
data[2] data[3] 代表X的变化
data[4] data[5] 代表Y的变化
0x05, 0x0C, // USAGE_PAGE (Consumer)
0x09, 0x01, // USAGE (Consumer Control)
0xA1, 0x01, // COLLECTION (Application)
0x85, 0x03, // Report ID 03
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x25, 0x01, // LOGICAL_MAXIMUM (1)
0x75, 0x01, // REPORT_SIZE (1)
0x95, 0x18, // REPORT_COUNT (24)
0x0A, 0x40, 0x00, // USAGE (menu):0x40
0x0A, 0x92, 0x01, // USAGE (AL Calculator):0x192
0x0A, 0x83, 0x01, // USAGE (AL Consumer Control Configuration):0x183
0x0A, 0x23, 0x02, // USAGE (AC Home):0x223
0x0A, 0x8A, 0x01, // USAGE (AL Email Reader):0x18A
0x0A, 0x82, 0x01, // USAGE (AL Programmable Button Configuration):0x182
0x0A, 0x21, 0x02, // USAGE (AC Search):0x221
0x0A, 0x24, 0x02, // USAGE (AC Back):0x224
0x0A, 0x25, 0x02, // USAGE (AC Forward):0x225
0x0A, 0x26, 0x02, // USAGE (AC Stop):0x226
0x0A, 0x27, 0x02, // USAGE (AC Refresh):0x227
0x09, 0xB6, // USAGE (Scan Previous Track)
0x09, 0xB5, // USAGE (Scan Next Track)
0x09, 0xB7, // USAGE (Stop)
0x09, 0xCD, // USAGE (Play Pause)
0x09, 0xE9, // USAGE (Volume Increment)
0x09, 0xEA, // USAGE (Volume Decrement)
0x09, 0xE2, // USAGE (Mute)
0x09, 0xB8, // USAGE (Eject)
0x09, 0x30, // USAGE (Power)
0x0A, 0xB1, 0x01, // USAGE (AL Screen Saver):0x1B1
0x81, 0x02, // INPUT (Data,Var,Abs)
0x95, 0x01, // REPORT_COUNT (1)
0x75, 0x03, // REPORT_SIZE (3)
0x81, 0x03, // INPUT (Cnst,Var,Abs)
0xC0, // END_COLLECTION
根据以上判断,发送的data应该是4个byte, 1byte ID+ 3byte的consumer
如果想发送menu 的HID
data[0] = 0x3;
data[1] = 0x1;
data[2] = 0x0;
data[3] = 0x0;
如果想发送return / back 的HID
data[0] = 0x3;
data[1] = 0x80;
data[2] = 0x0;
data[3] = 0x0;
可以定制自己想要的任何按键