Skip to content

fix: gate wider mouse catalog buttons by HID capabilities#143

Merged
thisislvca merged 5 commits into
TomBadash:wider-mice-supportfrom
hieshima:fix/wider-mice-hid-capability-guardrail
May 5, 2026
Merged

fix: gate wider mouse catalog buttons by HID capabilities#143
thisislvca merged 5 commits into
TomBadash:wider-mice-supportfrom
hieshima:fix/wider-mice-hid-capability-guardrail

Conversation

@hieshima
Copy link
Copy Markdown
Collaborator

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:

  • MX Anywhere 2S has tilt controls and virtual gesture, but no Smart Shift / mode shift control.
  • MX Anywhere 3 / 3S expose Smart Shift and virtual gesture, but horizontal scroll is not represented as the same simple REPROG control shape.
  • MX Master 4 exposes a real 0x01A0 Haptic 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

  • Narrow supported_buttons using discovered REPROG_CONTROLS_V4 data.
  • Require divertable controls for HID-gated buttons:
    • mode_shift requires divertable 0x00C4
    • dpi_switch requires divertable 0x00FD
  • Pass the actual connected gesture state into device info:
    • active gesture CID
    • whether RawXY divert succeeded
  • Keep directional gesture mappings only when RawXY is supported and actually enabled.
  • Keep horizontal scroll catalog-driven for now, because Solaar data shows it can come from tilt, thumb wheel, virtual thumbwheel, or OS-level paths rather than one universal REPROG CID.
  • Keep MX Master 4 0x01A0 Haptic known-but-not-exposed instead of inventing a new unsupported button key.

Solaar evidence used

Scope

It does not add support for:

  • MX Master 4 action ring / haptic button mapping
  • Haptic feature configuration
  • Thumb wheel settings
  • High sensitivity scroll behavior
  • New config schema or migrations

This only makes #141’s static visual catalog safer by filtering HID-gated buttons against the runtime HID++ controls that were actually discovered.

Tests

uv run --with-requirements requirements.txt python -m unittest tests.test_logi_devices tests.test_hid_gesture tests.test_backend tests.test_device_layouts

Ran 94 tests in 0.110s
OK

uv run --with-requirements requirements.txt python -m unittest discover -s tests

Ran 298 tests in 23.282s
OK

@thisislvca thisislvca merged commit 00f29b9 into TomBadash:wider-mice-support May 5, 2026
1 check passed
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
@hieshima hieshima mentioned this pull request May 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants