Skip to content

Accept a zero gesture dead-zone instead of disabling all gestures - #1354

Merged
lujjjh merged 1 commit into
linearmouse:mainfrom
YuriNachos:fix/gesture-deadzone-zero-bound
Aug 28, 2026
Merged

lujjjh merged 1 commit into
linearmouse:mainfrom
YuriNachos:fix/gesture-deadzone-zero-bound

Conversation

@YuriNachos

Copy link
Copy Markdown
Contributor

Summary

GestureButtonTransformer.detectGesture guarded the axial-tolerance check with strict < deadZone, so a valid deadZone of 0 (@minimum 0, default 40) made absDelta < 0 always false and disabled every side-button gesture. A 0 dead zone should mean "only perfectly axial gestures are accepted", not "gestures off".

Root Cause

LinearMouse/EventTransformer/GestureButtonTransformer.swift, detectGesture: strict < instead of inclusive <= on the dead-zone comparison (the file already uses inclusive magnitude >= threshold comparisons elsewhere).

Changes

  • < deadZone -> <= deadZone on the Y (and X) dead-zone comparisons in detectGesture.
  • GestureButtonTransformerTests: a perfectly axial drag at deadZone == 0 is now detected (red before, green after); an off-axis drag is still rejected at deadZone == 0.

Verification

  • make lint — no new violations vs main.
  • GestureButtonTransformerTests passes (targeted run, headless, code signing disabled). CI runs the full suite.

Notes

1-px boundary shift for non-zero dead zones (negligible, strictly more correct: a tolerance of N px accepts drift 0..N inclusive).

detectGesture guarded the axial-tolerance check with a strict < deadZone
comparison, so a dead zone of 0 (valid, @Minimum 0, default 40) made
absDelta < 0 always false and every side-button gesture fell through to
no-op. Use <= so a 0 dead zone means 'only perfectly axial gestures are
accepted', matching the inclusive comparisons already used elsewhere.

Co-authored-by: Claude <[email protected]>
@lujjjh
lujjjh merged commit b4563a6 into linearmouse:main Aug 28, 2026
1 check passed
@lujjjh

lujjjh commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Thanks!

@lujjjh lujjjh added the bug Something isn't working label Sep 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants