fix: gate wider mouse catalog buttons by HID capabilities#143
Merged
thisislvca merged 5 commits intoMay 5, 2026
Merged
Conversation
hughesyadaddy
pushed a commit
to hughesyadaddy/Mouser
that referenced
this pull request
May 12, 2026
) * test: lock broader mouse catalog invariants * refactor: derive HID-gated buttons from reprog controls * feat: apply runtime button guardrail to connected HID devices * docs: document static catalog runtime guardrail * fix: gate catalog buttons by HID capabilities Co-authored-by: Cursor <[email protected]>
hieshima
added a commit
that referenced
this pull request
May 13, 2026
* test: lock broader mouse catalog invariants * refactor: derive HID-gated buttons from reprog controls * feat: apply runtime button guardrail to connected HID devices * docs: document static catalog runtime guardrail * fix: gate catalog buttons by HID capabilities
hieshima
added a commit
that referenced
this pull request
May 13, 2026
* test: lock broader mouse catalog invariants * refactor: derive HID-gated buttons from reprog controls * feat: apply runtime button guardrail to connected HID devices * docs: document static catalog runtime guardrail * fix: gate catalog buttons by HID capabilities
Closed
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.
Why
Follow-up to #141.
#141 adds broader MX Master / MX Anywhere visual catalog support, but the catalog still needs a runtime safety layer before those buttons are exposed to users.
The static catalog can say a device family has gesture, mode shift, horizontal scroll, or DPI switch controls, but the actual connected device may expose a different HID++ control set. Solaar’s device dumps show this clearly across the MX Anywhere and MX
Master families:
0x01A0Haptic control, but Mouser does not yet implement an action-ring/haptic button type.Without a runtime guardrail, #141 could make the UI show buttons that are only present in the visual catalog, not actually usable through the connected device’s HID++ capabilities.
What changed
supported_buttonsusing discoveredREPROG_CONTROLS_V4data.mode_shiftrequires divertable0x00C4dpi_switchrequires divertable0x00FD0x01A0Haptic known-but-not-exposed instead of inventing a new unsupported button key.Solaar evidence used
KeyFlag/MappingFlagdefine the relevantDIVERTABLE,RAW_XY, andFORCE_RAW_XYcapability bits: https://github.com/pwr-Solaar/Solaar/blob/master/lib/logitech_receiver/hidpp20.py0x01A0, Thumb Wheel, HiRes Wheel, and Virtual Gesture: https://github.com/pwr-Solaar/Solaar/blob/master/docs/devices/MX%20Master%204.textScope
It does not add support for:
This only makes #141’s static visual catalog safer by filtering HID-gated buttons against the runtime HID++ controls that were actually discovered.
Tests