Skip to content

feat: add macOS gesture swipe actions, debug tools, and HID fixes#8

Merged
TomBadash merged 9 commits intoTomBadash:masterfrom
thisislvca:gesture-master
Mar 16, 2026
Merged

feat: add macOS gesture swipe actions, debug tools, and HID fixes#8
TomBadash merged 9 commits intoTomBadash:masterfrom
thisislvca:gesture-master

Conversation

@thisislvca
Copy link
Copy Markdown
Collaborator

@thisislvca thisislvca commented Mar 15, 2026

Summary

This PR adds configurable gesture tap/swipe mappings, expands the in-app gesture debugging tools, fixes macOS scroll inversion handling, and improves Logitech BLE HID access on macOS when hidapi cannot open the vendor interface directly.

It also includes an initial Windows directional swipe path using HID++ RawXY.

Main Changes

  • Added separate mappings for:
    • gesture tap
    • swipe left
    • swipe right
    • swipe up
    • swipe down
  • Added gesture-direction detection with configurable threshold, deadzone, timeout, and cooldown settings
  • Added debug-mode plumbing from the hook/engine layers into the UI
  • Added an in-app debug panel with:
    • live gesture state
    • debug log output
    • gesture recording
    • a separate debug-events capture toggle
  • Added a system tray action to toggle debug mode
  • Fixed macOS vertical scroll inversion in the event tap path
  • Bumped config version to v3 and added migration for the new gesture/debug settings
  • Added a native macOS IOHIDDevice fallback for Logitech BLE devices when hidapi cannot open the vendor HID++ interface
  • Added an initial Windows directional swipe path using HID++ RawXY
  • Enabled the gesture swipe mapping UI on both macOS and Windows

macOS HID Fallback

On some macOS setups, hidapi can enumerate the Logitech BLE HID++ interface but still fail to open it.

This PR adds a native IOHIDDevice fallback for that case. The fallback prefers an exact HID interface match when available, but can also fall back to the BLE mouse device when IOHID does not expose the same primary-usage metadata as hidapi.

This restores working HID++ access on devices such as MX Master 3 Mac (PID 0xB023) after hidapi open failure.

Gesture Behavior

When HID++ gesture diversion is available, Mouser now:

  1. Diverts the Logitech gesture button (CID 0x00C3)
  2. Enables RawXY reporting when supported
  3. Tracks movement while the gesture button is held
  4. Detects swipe direction when movement crosses the configured thresholds
  5. Dispatches the configured action for tap or the detected swipe

If RawXY is not available, gesture handling falls back to tap-only behavior.

Platform Notes

  • macOS supports gesture tap plus directional swipes
  • Windows now has an initial directional swipe path using HID++ RawXY on supported Logitech devices
  • Windows devices that only reach the Raw Input fallback remain tap-only
  • Vertical scroll inversion is implemented in the hook layer on both platforms

Testing

  • Verified app startup on macOS
  • Verified Logitech BLE HID access on MX Master 3 Mac (PID 0xB023) through the native macOS fallback after hidapi open failure
  • Verified HID++ feature discovery for REPROG_V4
  • Verified RawXY enablement on a connected macOS device
  • Verified config migration paths for the new gesture/debug settings in code
  • Verified that macOS vertical scroll inversion is wired through the hook path
  • Verified syntax/build sanity for the Windows gesture swipe implementation in code

Remaining Gaps

  • Windows directional swipe behavior still needs hardware validation on a supported Logitech device

@thisislvca thisislvca changed the title Gesture master feat: add gesture button swipe actions and debug mode Mar 15, 2026
@thisislvca thisislvca changed the title feat: add gesture button swipe actions and debug mode feat: add macOS gesture swipe actions, debug tools, and HID fixes Mar 15, 2026
@TomBadash TomBadash merged commit a96d78b into TomBadash:master Mar 16, 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