summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2021-07-10 09:07:22 +0300
committerDevaev Maxim <[email protected]>2021-07-10 09:07:22 +0300
commit994b8a62ea256a53585e6ef22c82004bea626839 (patch)
tree11dfcc566deec7bea46c2813492b2a311feb4f39
parent01514d2e6aa2929666938a9d568954a3a9a9fdfc (diff)
fixed absolute mouse for apple recovery
-rw-r--r--hid/patch.py1
-rw-r--r--hid/patches/hid-abs-mouse-mac-fix.patch23
2 files changed, 24 insertions, 0 deletions
diff --git a/hid/patch.py b/hid/patch.py
index 2695901b..520368e5 100644
--- a/hid/patch.py
+++ b/hid/patch.py
@@ -41,4 +41,5 @@ _libs = _get_libs()
_patch(_libs["HID-Project"], "patches/hid-shut-up.patch")
_patch(_libs["HID-Project"], "patches/hid-no-singletones.patch")
_patch(_libs["HID-Project"], "patches/hid-abs-mouse-win-fix.patch")
+_patch(_libs["HID-Project"], "patches/hid-abs-mouse-mac-fix.patch")
_patch(_libs["HID-Project"], "patches/hid-boot-mouse-mac-fix.patch")
diff --git a/hid/patches/hid-abs-mouse-mac-fix.patch b/hid/patches/hid-abs-mouse-mac-fix.patch
new file mode 100644
index 00000000..57fef195
--- /dev/null
+++ b/hid/patches/hid-abs-mouse-mac-fix.patch
@@ -0,0 +1,23 @@
+diff --git a/src/SingleReport/SingleAbsoluteMouse.cpp b/src/SingleReport/SingleAbsoluteMouse.cpp
+index bad902c..88d16f0 100644
+--- a/src/SingleReport/SingleAbsoluteMouse.cpp
++++ b/src/SingleReport/SingleAbsoluteMouse.cpp
+@@ -29,6 +29,10 @@ static const uint8_t _hidSingleReportDescriptorAbsoluteMouse[] PROGMEM = {
+ 0x09, 0x02, /* USAGE (Mouse) */
+ 0xA1, 0x01, /* COLLECTION (Application) */
+
++ /* Pointer and Physical are required by Apple Recovery */
++ 0x09, 0x01, /* USAGE (Pointer) */
++ 0xa1, 0x00, /* COLLECTION (Physical) */
++
+ /* 8 Buttons */
+ 0x05, 0x09, /* USAGE_PAGE (Button) */
+ 0x19, 0x01, /* USAGE_MINIMUM (Button 1) */
+@@ -58,6 +62,7 @@ static const uint8_t _hidSingleReportDescriptorAbsoluteMouse[] PROGMEM = {
+ 0x81, 0x06, /* INPUT (Data,Var,Rel) */
+
+ /* End */
++ 0xc0, /* END_COLLECTION (Physical) */
+ 0xc0 /* END_COLLECTION */
+ };
+