-
Notifications
You must be signed in to change notification settings - Fork 35
feat(gearhub): GearHub-V5 driver + Attack Shark R2 - #72
Merged
snekxs merged 3 commits intoSep 7, 2026
Merged
Conversation
Split the Lingbao M5 Pro driver into a vendor-neutral GearHub-V5 codec (src/gearhub/) and WebHID driver (src/drivers/gearhub/), and add Attack Shark R2 support. Both mice ship on the MicLink/mlzn ODM platform and share VID:PID 0x3151:0x402D; they are told apart by the GET_USB_VERSION device id (M5 Pro 2285, R2 1893) - the same key GearHub's own bundle uses. An unrecognised id falls back to the M5 Pro profile, so nothing regresses. R2 support, verified on retail hardware over the 2.4 GHz receiver: - identity: PixArt PAW3950, 42000 DPI, 8000 Hz, firmware v2.01 - report rate: was written with a phantom 0x03/0x83 opcode the firmware ignores; now read-modify-writes the OPTIONPARAM0 block (GET 0xD3 / SET 0x53, byte 9, bitmask codes) - lift-off, debounce, straight/ripple correction, 2.4G + BT standby time: all fields of the same OPTIONPARAM0 block - button remapping: GET/SET_KEYMATRIX (0xD0 / 0x50), 6 buttons, mouse functions only (Left/Right/Middle/Back/Forward/DPI/Disabled) waitReady's retry window went 5 -> 8 and GET_KEYMATRIX retries once, which also makes the M5 Pro relay path more tolerant under load. M5 Pro wired mode (PID 0x4026) and the R2's wired mode were not tested. registry.ts / fantech / vendors repointed to @openmouse/protocol/gearhub; tsconfig paths and package exports updated. Full suite (1102 tests) green. Claude-Session: https://claude.ai/code/session_01GbCML9iSWvPq9hweRx5wAn
Resolve conflict in src/drivers/vendors.ts: keep LOGITECH_BLUETOOTH_FILTERS from main alongside GEARHUB_HID_FILTERS, dropping the now-superseded LINGBAO_HID_FILTERS (this branch already renamed/replaced the lingbao driver with gearhub). Claude-Session: https://claude.ai/code/session_01Dzm4PG7ruKhs5UygrBT4ye
snekxs
pushed a commit
to OpenMouse-Project/openmouse
that referenced
this pull request
Sep 7, 2026
The R2 driver lands in OpenMouse-Project/mouse-protocol#72 (new gearhub family). This wires up the OpenMouse side: - supported-mice.ts: R2 row bridge -> supported. It is a GearHub-V5 ODM mouse on VID 0x3151 / PID 0x402D (shared with the Lingbao M5 Pro receiver); the gearhub driver identifies it by the protocol device id 1893. PixArt PAW3950, 42000 DPI, 8000 Hz. DPI, polling, lift-off, debounce, move-correction, sleep and 6-button remapping all verified on hardware over the 2.4 GHz receiver. - traits.ts: gearhub family entry (advancedSection + sleep + debounce), so the shared advanced/sleep/debounce cards and the generic button remapper render. Plain flags, not direct-mode - the driver publishes its own debounce/sleep option lists. - device-images.ts: name-fallback mapping "Attack Shark R2" -> attackshark-r2.png. Can't key on PID 0x402D (shared with the M5 Pro), so it resolves from the reported name. Falls back to the placeholder until a maintainer uploads the render to the devices bucket; provenance stub added to public/devices/README.md. Requires mouse-protocol#72 first; the @openmouse/protocol lockfile entry needs a bump once that merges. https://claude.ai/code/session_01GbCML9iSWvPq9hweRx5wAn
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
What
Splits the
lingbaodriver into a vendor-neutral GearHub-V5 codec(
src/gearhub/) and WebHID driver (src/drivers/gearhub/), and addsAttack Shark R2 support.
The R2 and the Lingbao M5 Pro ship on the same MicLink/mlzn ODM platform
(qmk.top's "GearHub-V5") and enumerate with the same VID:PID
0x3151:0x402D. Driver selection can't tell them apart, so one driverclaims the pair and identifies the model from the
GET_USB_VERSIONdeviceid after connecting - the same key GearHub's own bundle uses (M5 Pro
2285,R2
1893). An unrecognised id falls back to the M5 Pro profile, so theexisting M5 Pro path does not regress.
R2 features (verified on retail hardware, 2.4 GHz receiver)
0x03/0x83opcode the firmware silently ignores; now read-modify-writes the OPTIONPARAM0 block (GET0xD3/ SET0x53, byte 9, bitmask codes1000->1 ... 8000->129)GET/SET_KEYMATRIX(0xD0/0x50), 6 buttons, mouse functions only (Left/Right/Middle/Back/Forward/DPI/Disabled) - matches OpenMouse's generic remapperGET_KEYMATRIXis the one read with no echo byte, so its reply check isrelaxed to the all-zero guard only.
Other changes
waitReady's retry window5 -> 8, andGET_KEYMATRIXretries once(it's the last exchange in
readStatusand the relay is more likely tomiss its ready window under load). This also makes the M5 Pro relay path
a little more tolerant.
registry.ts/fantech/vendors.tsrepointed to@openmouse/protocol/gearhub;tsconfigpaths +package.jsonexportsupdated;
lingbao/removed.Not tested
0x4026) - unchanged by this PR, though itstransport entry moved.
R2 wired mode (PID
0x4026) has since been confirmed on hardware.Checks
npm run checkgreen - full suite 1102 tests.