最近在做USB touchpad,发现touchpad和touchscreen有些区别,而且不同的操作系统也有些差异,下面以windows系统进行说明:
根据微软文档(https://docs.microsoft.com/zh-cn/windows-hardware/design/component-guidelines/windows-precision-touchpad-required-hid-top-level-collections),一台 Windows 精确式触摸板设备应公开 3 个必需的顶级集合;Windows 精确式触摸板、鼠标和配置。 还可以实现可选(建议)的固件更新集合。实际测试时发现不要鼠标集合时,触控按钮是有效的,但光标无法移动。
微软给了touchpad的报告标识符示例(https://docs.microsoft.com/zh-cn/windows-hardware/design/component-guidelines/windows-precision-touchpad-sample-report-descriptors),但需要执行定义report id(不重复,不为0即可)
//TOUCH PAD input TLC
0x05, 0x0d, // USAGE_PAGE (Digitizers)
0x09, 0x05, // USAGE (Touch Pad)
0xa1, 0x01, // COLLECTION (Application)
0x85, REPORTID_TOUCHPAD, // REPORT_ID (Touch pad)
0x09, 0x22, // USAGE (Finger)
0xa1, 0x02, // COLLECTION (Logical)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x25, 0x01, // LOGICAL_MAXIMUM (1)
0x09, 0x47, // USAGE (Confidence)
0x09, 0x42, // USAGE (Tip switch)
0x95, 0x02, // REPORT_COUNT (2)
0x75, 0x01, // REPORT_SIZE (1)
0x81, 0x02, // INPUT (Data,Var,Abs)
0x95, 0x01, // REPORT_COUNT (1)
0x75, 0x02, // REPORT_SIZE (2)
0x25, 0x02, // LOGICAL_MAXIMUM (2)
0x09, 0x51, // USAGE (Contact Identifier)
0x81, 0x02, // INPUT (Data,Var,Abs)
0x75, 0x01, // REPORT_SIZE (1)
0x95, 0x04, // REPORT_COUNT (4)
0x81, 0x03, // INPUT (Cnst,Var,Abs)
0x05, 0x01, // USAGE_PAGE (Generic Desk..
0x15, 0x00,