feat(macos): support physical scroll wheel tilt and reduce remapping latency#216
Open
Archetipo95 wants to merge 2 commits into
Open
feat(macos): support physical scroll wheel tilt and reduce remapping latency#216Archetipo95 wants to merge 2 commits into
Archetipo95 wants to merge 2 commits into
Conversation
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.
This PR enables physical scroll/tilt wheels (like the Logitech MX Anywhere 2 left/right tilt) to function reliably on macOS even when Ignore trackpad is enabled, and adds support for ultra-low horizontal scroll thresholds to eliminate delay when triggering mapped keystrokes.
Key Changes
core/mouse_hook_macos.py, we inspectkCGScrollWheelEventScrollPhaseandkCGScrollWheelEventMomentumPhase. Trackpads and Magic Mice always generate gesture events with non-zero phases, while traditional mice/tilt-wheels do not (both phases are0). We now verify if these phases are non-zero before filtering, letting physical wheel tilt inputs pass through even whenignore_trackpadis enabled.core/engine.py, we lowered the minimum threshold cap to0.01(from0.1), allowing users to specify a threshold like0.1or lower in their configuration. This fires mapped actions instantly on the very first tilt event.hscroll_leftandhscroll_rightusing the"mapping"type instead of"hscroll"incore/logi_device_catalog.py, allowing them to be mapped separately in the UI.core/config.pytype validation to allow floats for numeric default config templates, and updated the mock setups intests/test_mouse_hook.pyandtests/test_device_layouts.py.