Skip to content

Treat the tilt wheel as a virtual button#925

Open
yutokun wants to merge 1 commit into
Caldis:masterfrom
yutokun:dev/tilt-wheel-as-button
Open

Treat the tilt wheel as a virtual button#925
yutokun wants to merge 1 commit into
Caldis:masterfrom
yutokun:dev/tilt-wheel-as-button

Conversation

@yutokun
Copy link
Copy Markdown

@yutokun yutokun commented Apr 23, 2026

Summary

Enabled tilt wheel support by treating it as a virtual button, allowing users to assign custom actions to it. Tested with MX Anywhere 2S.

Changes

  • Virtual Key Codes (KeyCode.swift): Added tiltLeft = 21 and tiltRight = 22, displayed as 🖱← and 🖱→ in the UI.
  • Filtering Logic: Tilt events are ignored in the following cases:
    • Events originating from a trackpad.
    • Horizontal events triggered while the Shift key is pressed or toggleScroll is enabled.
    • Events containing vertical components (only pure horizontal inputs are accepted).

Screenshots

SCR-20260423-nqty
Tilt.to.switch.space.mp4

Treat pure horizontal wheel tilts as virtual buttons (tiltLeft=21,
tiltRight=22) that can be bound in ButtonsView and recorded via
KeyRecorder. A new TiltWheelHandler converts the continuous tilt
stream into down/up lifecycles with keyboard-style auto-repeat, and
suppresses macOS Shift+scroll / toggleScroll induced horizontal
scrolls to avoid false triggers.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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