Skip to content

Stop finger taps from arriving as right clicks - #40

Merged
thirteen37 merged 1 commit into
mainfrom
fix/ipad-tap-invokes-right-click
Aug 21, 2026
Merged

thirteen37 merged 1 commit into
mainfrom
fix/ipad-tap-invokes-right-click

Conversation

@thirteen37

Copy link
Copy Markdown
Owner

Summary

  • buttonMaskRequired is only evaluated for indirect input devices. A direct touch carries no buttons, so a finger tap satisfied both the primary and the secondary tap recognizer. UIKit lets only one of them recognize, and the secondary one — added last — won, so every tap reached the host as a right click.
  • This was true all along. It only became visible once Hold synthesized iPad presses long enough for the host to see them #39 held presses long enough for the host to register them at all; before that no click landed, so there was nothing to tell you which button it was.
  • Restricting the secondary recognizer to .indirectPointer leaves finger taps to the primary recognizer, while trackpad and mouse right clicks still route correctly. Apple Pencil taps now land as left clicks too.
  • Bumps MARKETING_VERSION to 1.0.5 for the next release.

Verification

The regression test asserts the touch-type restriction. I confirmed it genuinely catches the bug by removing the fix and re-running — it fails with:

XCTAssertEqual failed: ("Optional([0, 1, 2, 3])") is not equal to ("Optional([3])")

[0, 1, 2, 3] is every touch type including .direct (0), which is the bug stated precisely: the secondary recognizer was accepting finger taps.

Test plan

  • iPad tests pass (19/19), including the new test_secondaryTapIgnoresDirectTouches
  • Test verified to fail without the fix
  • Hardware: a finger tap produces a left click
  • Hardware: a trackpad/mouse secondary click still produces a right click
  • Hardware: keyboard input still works (confirmed working on 1.0.4)

🤖 Generated with Claude Code

buttonMaskRequired is only evaluated for indirect input devices. A direct
touch carries no buttons, so it satisfied both the primary and the secondary
tap recognizer; UIKit let only one of them recognize, and the secondary one
won. Every tap reached the host as a right click.

This was always the case — it only became visible once presses were held long
enough for the host to see them at all. Restricting the secondary recognizer
to indirect pointer input leaves finger taps to the primary one, while a
trackpad or mouse right click still routes correctly.

Also bumps the marketing version for the next release.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XU7Ck7AbZ9KpRhdPbRzNj8
@thirteen37
thirteen37 merged commit f8ef9b3 into main Aug 21, 2026
3 checks passed
@thirteen37
thirteen37 deleted the fix/ipad-tap-invokes-right-click branch August 21, 2026 14:21
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