Skip to content

feat: add runtime device capability inventory#1

Open
hieshima wants to merge 3 commits into
fix/wider-mice-hid-capability-guardrailfrom
feat/device-capability-inventory
Open

feat: add runtime device capability inventory#1
hieshima wants to merge 3 commits into
fix/wider-mice-hid-capability-guardrailfrom
feat/device-capability-inventory

Conversation

@hieshima
Copy link
Copy Markdown
Owner

Why

Stacked on TomBadash#143.

TomBadash#141 adds broader MX Master / MX Anywhere visual catalog support, and TomBadash#143 gates static catalog buttons against discovered HID++ controls. This PR turns that guardrail into a first-class runtime capability inventory so future device support can be added from real HID++ evidence instead of only static model/catalog assumptions.

This is motivated by current device-support issues with useful runtime dumps:

What changed

  • Added DeviceCapabilityInventory, derived from runtime HID++ data:
    • discovered REPROG_CONTROLS_V4 controls
    • selected gesture CID
    • RawXY gesture status
    • discovered feature IDs
  • Kept supported_buttons as the UI-facing result, but now derives it from the inventory.
  • Kept derive_supported_buttons_from_reprog_controls() as a compatibility wrapper for fix: gate wider mouse catalog buttons by HID capabilities TomBadash/Mouser#143.
  • Added capability_inventory to Copy device info dumps so future issues/PRs show Mouser’s capability decisions directly.
  • Added conservative issue-backed recognition for:
    • M720 Triathlon
    • MX Ergo
    • ERGO M575 Trackball
  • Recorded known unsupported controls instead of exposing them prematurely:
    • 0x01A0 as MX Master 4 haptic/action-ring
    • 0x00ED as MX Ergo precision mode
  • Updated CONTRIBUTING_DEVICES.md to require runtime capability evidence for future device support PRs.

Scope

This does not add full support for M720 / MX Ergo / M575 yet.

The new device entries are conservative: they improve recognition and runtime capability filtering without pretending every physical control is fully supported.

It intentionally does not add:

  • dedicated visual layouts or new image assets for those devices
  • new button keys for MX Master 4 action ring / haptic
  • precision-mode remapping for MX Ergo
  • high-res / high-sensitivity scroll behavior
  • G-series gaming mouse support
  • config schema changes or migrations

Compatibility

  • Existing fix: gate wider mouse catalog buttons by HID capabilities TomBadash/Mouser#143 behavior is preserved: callers can still use derive_supported_buttons_from_reprog_controls().
  • Backend/QML still consume supported_buttons; they do not need to know about the new inventory.
  • Older/minimal control dumps without flags keep the previous CID-only behavior.
  • Unknown controls are surfaced in diagnostics but not exposed to users as remappable buttons.

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 100 tests in 0.066s
OK

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

Ran 304 tests in 23.199s
OK

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.

1 participant