Version 4.0.0 - Refactor Trackpad API#167
Open
unhuman wants to merge 1 commit into
Open
Conversation
unhuman
commented
Apr 28, 2026
fix: Replace CGEvent tap with IOHIDManager for physical click detection
- Physical click detection now uses IOHIDManager, which receives actual
hardware button-press events at the kernel HID layer. Three Finger Drag
synthesises leftMouseDown events at the CGEvent/accessibility layer and
is therefore completely invisible to IOHIDManager — TFD now works
alongside MiddleClick without conflict.
- Remove CGEventController and the CGEvent tap (Controller+Mouse.swift).
wasLeftConverted, wasRightConverted, physicalClickArmed, and lastClickTime
are removed from GlobalState. HIDClickHandler synthesises otherMouseDown/Up
directly, rather than intercepting and mutating existing events.
- HIDClickHandler gates conversion on a 60 ms stable contact window
(threeDownSince, re-added to GlobalState) to filter pressure-deformation
transients during 2-finger clicks, matching the original arming intent.
- Fix tap-to-click false positives: remove the 'early lift' promotion
in TouchHandler (armed → stableArmed when count drops after ≥ 50 ms).
The qualifying finger count must now remain stable until all contacts
lift together, preventing a slow 3-finger scroll or resting thumb from
accidentally arming a middle click.
- Remove Three Finger Drag from the conflict detection alert
(Controller+Conflicts.swift) since TFD is no longer a conflict.
- Update docs/three-finger-drag.md and docs/CHANGELOG.md.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.