Commit d9e4bfe
committed
feat: add MX Master 4 support with Actions Ring and haptic feedback
Phase 1 implementation:
Core Device Support:
- Register MX Master 4 (PID 0xB042) as variant of MX Master 3S
- Add Actions Ring button (CID 0x01A0) as fully remappable control
- Add dedicated device layout with 7 hotspots including Actions Ring
- Use mxm4.png image asset for visual representation
Haptic Feedback Backend:
- Implement HID++ 2.0 HAPTIC feature (0x19B0) with:
- getCapabilities (function 0)
- getState (function 1)
- setState with 4 discrete levels: subtle/low/medium/high
- playWaveform for test feedback
- Detect FORCE_SENSING_BUTTON feature (0x19C0) as placeholder
- Add queue+wait pattern for HID++ command processing
- Replay saved haptic level on device reconnect
UI & Configuration:
- Add Haptic Feedback page in sidebar (conditional on MX Master 4 connection)
- Haptic Feedback page: intensity selector (4 buttons) + test button + note
- Config migration v8->v9: register actions_ring button, add haptic_level setting
- Add i18n strings for haptic UI (en, zh_CN, zh_TW)
Mouse Hook:
- Add ACTIONS_RING_DOWN/UP events for actions ring button presses
- Implement divert handlers in all platform impls (Windows/macOS/Linux)
- Actions ring integration follows existing gesture button patterns
Testing:
- 16 new tests across 5 test files:
- Device registry: button definition, product ID lookup, image asset
- Device layouts: dedicated layout exists, hotspots correct, no fallback
- Config migration: v8->v9 adds actions_ring and haptic_level
- HID++: KNOWN_CID_NAMES includes Actions Ring, feature constants defined
- Mouse hook: ACTIONS_RING event constants exist
No regressions for MX Master 3S -- all existing behavior unchanged.
Phase 1 excludes:
- Per-event haptic routing policy (phase 2)
- Force Sensing Button configuration (detection only)
- Swipe gesture actions (future)1 parent 945c332 commit d9e4bfe
16 files changed
Lines changed: 846 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
| 68 | + | |
67 | 69 | | |
68 | 70 | | |
69 | 71 | | |
70 | | - | |
| 72 | + | |
71 | 73 | | |
72 | 74 | | |
73 | 75 | | |
| |||
85 | 87 | | |
86 | 88 | | |
87 | 89 | | |
| 90 | + | |
88 | 91 | | |
89 | 92 | | |
90 | 93 | | |
| |||
106 | 109 | | |
107 | 110 | | |
108 | 111 | | |
| 112 | + | |
109 | 113 | | |
110 | 114 | | |
111 | 115 | | |
| |||
321 | 325 | | |
322 | 326 | | |
323 | 327 | | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
324 | 338 | | |
325 | 339 | | |
326 | 340 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
87 | 171 | | |
88 | 172 | | |
89 | 173 | | |
| |||
208 | 292 | | |
209 | 293 | | |
210 | 294 | | |
| 295 | + | |
211 | 296 | | |
212 | 297 | | |
213 | 298 | | |
| |||
217 | 302 | | |
218 | 303 | | |
219 | 304 | | |
220 | | - | |
221 | 305 | | |
222 | 306 | | |
223 | 307 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
121 | 131 | | |
122 | 132 | | |
123 | 133 | | |
| |||
491 | 501 | | |
492 | 502 | | |
493 | 503 | | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
494 | 509 | | |
495 | 510 | | |
496 | 511 | | |
| |||
667 | 682 | | |
668 | 683 | | |
669 | 684 | | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
670 | 709 | | |
671 | 710 | | |
672 | 711 | | |
| |||
0 commit comments