我司目前想通过CH554通过串口接收Android主板USB mouse事件(比如mouse 坐标以及滚轮事件(前滚,后滚)基本功能)来实现对其他PC的反控功能。目前实现可以进行鼠标左边、右键以及鼠标移动的反控,但是wheel控制时,被反控的windows端没有反应。目前Android下发的wheel前滚后滚事件被映射成0x01, 0xff两个值,我这边的报告描述符如下:
0x05, 0x01, // Usage Page (Generic Desktop Ctrls) 0x09, 0x02, // Usage (Mouse) 0xA1, 0x01, // Collection (Application) 0x85, MOUSE_EVT_REPORT_ID, /* REPORT_ID (04) */ 0x09, 0x01, // Usage (Pointer) 0xA1, 0x00, // Collection (Physical) /*1byte for button*/ 0x05, 0x09, // Usage Page (Button) 0x19, 0x01, // Usage Minimum (0x01), 1 left key, 2 right key, 3 middle key 0x29, 0x03, // Usage Maximum (0x03) 0x15, 0x00, // Logical Minimum (0) 0x25, 0x01, // Logical Maximum (1) 0x75, 0x01, // Report Size (1): 0x95, 0x03, // Report Count (3): 3bit to describe key event, bit-0{left}, bit-1{right}, bit-2{middle}; set 1 for press, 0 for release 0x81, 0x02, // Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position) 0x75, 0x05, // Report Size (5) 0x95, 0x01, // Report Count (1): 5bit padding for byte align, should set all 0 0x81, 0x03, // Input (Const,Array,Abs,No Wrap,Linear,Preferred State,No Null Position) 0x05, 0x01, // Usage Page (Generic Desktop Ctrls) 0x09, 0x38, // USAGE (Wheel) 0x15, 0x81, // Logical Minimum (127) 0x25 , 0x7f, // LOGIC_MAX (-127): 0x01 scroll forward, 0xff: scroff back 0x75, 0x08, // REPORT_SIZE (8) 0x95, 0x01, // REPORT_COUNT (1) 0x81, 0x06, // Input (Data,Var,Res,No Wrap,Linear,Preferred State,No Null Position) 0x09 , 0x30 , // USAGE X 0x15, 0x00, // Logical Minimum (0) 0x26 , 0x00 , 0x10, // LOGIC_MAX (0X1000) 0x35 , 0x00 , // PHYSICAL_MIN (0) 0x46 , 0x00 , 0x10 , // 0x79 , 0x08 PHYSICAL_MAX (0X1000) 0x75, 0x10, // REPORT_SIZE (16) 0x95, 0x01, // REPORT_COUNT (1) 0x81 , 0x02 , // INPUT (Data,Var,ABS) 0x09 , 0x31 , // USAGE Y 0x15, 0x00, // Logical Minimum (0) 0x26 , 0x00 , 0x10, // LOGIC_MAX (0X1000) 0x35 , 0x00 , // PHYSICAL_MIN (0) 0x46 , 0x00 , 0x10, // 0x4c , 0x05 PHYSICAL_MAX (0X1000) 0x75, 0x10, // REPORT_SIZE (16) 0x95, 0x01, // REPORT_COUNT (1) 0x81 , 0x02 , // INPUT (Data,Var,Abs) 0xC0, // End Collection 0xC0, // End Collection
还麻烦指点一下wheel的控制。 PS:通过USB转包,也能看见数据包按照report描述符进行了上报,但是windows端对wheel没啥反应。