mirror of https://github.com/Genymobile/scrcpy
Fix HID comments
Fix typo and reference the latest version of "HID Usage Tables" specifications. PR #5270 <https://github.com/Genymobile/scrcpy/pull/5270>
This commit is contained in:
parent
1f5be743b4
commit
de8455400c
|
@ -31,13 +31,16 @@
|
||||||
* For HID, only report descriptor is needed.
|
* For HID, only report descriptor is needed.
|
||||||
*
|
*
|
||||||
* The specification is available here:
|
* The specification is available here:
|
||||||
* <https://www.usb.org/sites/default/files/hid1_11.pdf>
|
* <https://www.usb.org/document-library/device-class-definition-hid-111>
|
||||||
*
|
*
|
||||||
* In particular, read:
|
* In particular, read:
|
||||||
* - 6.2.2 Report Descriptor
|
* - §6.2.2 Report Descriptor
|
||||||
* - Appendix B.1 Protocol 1 (Keyboard)
|
* - Appendix B.1 Protocol 1 (Keyboard)
|
||||||
* - Appendix C: Keyboard Implementation
|
* - Appendix C: Keyboard Implementation
|
||||||
*
|
*
|
||||||
|
* The HID Usage Tables is also useful:
|
||||||
|
* <https://www.usb.org/document-library/hid-usage-tables-15>
|
||||||
|
*
|
||||||
* Normally a basic HID keyboard uses 8 bytes:
|
* Normally a basic HID keyboard uses 8 bytes:
|
||||||
* Modifier Reserved Key Key Key Key Key Key
|
* Modifier Reserved Key Key Key Key Key Key
|
||||||
*
|
*
|
||||||
|
@ -60,7 +63,7 @@ static const uint8_t SC_HID_KEYBOARD_REPORT_DESC[] = {
|
||||||
0x05, 0x07,
|
0x05, 0x07,
|
||||||
// Usage Minimum (224)
|
// Usage Minimum (224)
|
||||||
0x19, 0xE0,
|
0x19, 0xE0,
|
||||||
// Usage Maximum (231)
|
// Usage Maximum (231)
|
||||||
0x29, 0xE7,
|
0x29, 0xE7,
|
||||||
// Logical Minimum (0)
|
// Logical Minimum (0)
|
||||||
0x15, 0x00,
|
0x15, 0x00,
|
||||||
|
|
|
@ -6,13 +6,13 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mouse descriptor from the specification:
|
* Mouse descriptor from the specification:
|
||||||
* <https://www.usb.org/sites/default/files/hid1_11.pdf>
|
* <https://www.usb.org/document-library/device-class-definition-hid-111>
|
||||||
*
|
*
|
||||||
* Appendix E (p71): §E.10 Report Descriptor (Mouse)
|
* Appendix E (p71): §E.10 Report Descriptor (Mouse)
|
||||||
*
|
*
|
||||||
* The usage tags (like Wheel) are listed in "HID Usage Tables":
|
* The usage tags (like Wheel) are listed in "HID Usage Tables":
|
||||||
* <https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf>
|
* <https://www.usb.org/document-library/hid-usage-tables-15>
|
||||||
* §4 Generic Desktop Page (0x01) (p26)
|
* §4 Generic Desktop Page (0x01) (p32)
|
||||||
*/
|
*/
|
||||||
static const uint8_t SC_HID_MOUSE_REPORT_DESC[] = {
|
static const uint8_t SC_HID_MOUSE_REPORT_DESC[] = {
|
||||||
// Usage Page (Generic Desktop)
|
// Usage Page (Generic Desktop)
|
||||||
|
@ -34,7 +34,7 @@ static const uint8_t SC_HID_MOUSE_REPORT_DESC[] = {
|
||||||
|
|
||||||
// Usage Minimum (1)
|
// Usage Minimum (1)
|
||||||
0x19, 0x01,
|
0x19, 0x01,
|
||||||
// Usage Maximum (5)
|
// Usage Maximum (5)
|
||||||
0x29, 0x05,
|
0x29, 0x05,
|
||||||
// Logical Minimum (0)
|
// Logical Minimum (0)
|
||||||
0x15, 0x00,
|
0x15, 0x00,
|
||||||
|
@ -62,9 +62,9 @@ static const uint8_t SC_HID_MOUSE_REPORT_DESC[] = {
|
||||||
0x09, 0x31,
|
0x09, 0x31,
|
||||||
// Usage (Wheel)
|
// Usage (Wheel)
|
||||||
0x09, 0x38,
|
0x09, 0x38,
|
||||||
// Local Minimum (-127)
|
// Logical Minimum (-127)
|
||||||
0x15, 0x81,
|
0x15, 0x81,
|
||||||
// Local Maximum (127)
|
// Logical Maximum (127)
|
||||||
0x25, 0x7F,
|
0x25, 0x7F,
|
||||||
// Report Size (8)
|
// Report Size (8)
|
||||||
0x75, 0x08,
|
0x75, 0x08,
|
||||||
|
|
Loading…
Reference in New Issue