Skip to content

Option to use the stream picture as a relative trackpad (#178) - #222

Open
addhumal wants to merge 6 commits into
Saffsanity:mainfrom
addhumal:touch-mode
Open

addhumal wants to merge 6 commits into
Saffsanity:mainfrom
addhumal:touch-mode

Conversation

@addhumal

@addhumal addhumal commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Closes #178.

What it does

  • Adds TouchMode (Direct Touch vs Trackpad, saved in Sill.touchMode, default Direct Touch) to PointerPresence.swift and Settings › This iPad / This iPhone.
  • When Trackpad is selected, overlays TrackpadView on the stream picture pane and enables the virtual cursor sprite (TouchMode.showsPointer(isPortrait:mode:)) in both landscape and portrait so dragging anywhere on the picture moves the pointer relatively, tapping clicks at the pointer, pressing and holding drags, and two fingers scroll.
  • The tour's picture card follows the mode (TourFeatures.trackpadMode): in Trackpad mode it is "The Picture Is a Trackpad" (drag to move the pointer, tap to click, two fingers to right-click and to scroll, hold then drag, and the three-finger swipe row as before), without direct touch's rows.
  • The iPad's own trackpad or mouse over the picture in Trackpad mode: its scroll and hover fall through to the picture as in Direct Touch (TrackpadSurface.point(inside:with:)).
  • Changing the mode gives back the whole picture: a zoom made before Trackpad mode couldn't be pinched out under it.

Known

Why

  • On small screens or dense UIs in landscape, direct touch can be hard to aim accurately (Option to switch between trackpad and mouse mode #178). Letting the user switch the stream surface to relative trackpad movement gives full-screen landscape streaming the precision of the portrait trackpad without giving up screen space.

Checks

  • Merged with main (52dbbde): the three conflicts kept both sides (main's zoom and key-repeat arguments to InputOverlay, then the Trackpad overlay).
  • Tests/checks/tour: 732,453 checks, 129 of 129 mutants (6 checks and 3 mutants new); run-all.sh: all 63.
  • Tests/checks/pointer-presence: 171 checks, 0 failed; 46 of 46 mutants caught (3 new).
  • iOS Simulator Debug build (Sill.xcodeproj) clean.

What I tried

  • On a 14-inch MacBook Pro (M4 Pro, macOS 27.0.1), Xcode 27.2: the three iOS builds (Debug and Release for the simulator, Debug for a device) and the pure checks above, after the merge with main and after each fix.
  • Trackpad mode itself has not been run since the merge: not on a simulator, not on an iPad or iPhone. The scroll and hover fall-through and the zoom reset are checked by the build only.

Not tested

  • The scroll and hover fall-through with a real Magic Keyboard trackpad or mouse (no harness sends scroll or hover events).

…does (Saffsanity#178)

With Trackpad mode on, the trackpad lies over the picture, so the card's direct-touch rows (tap and
hold where you touch, drag to scroll, the Pencil, and the pinch main added with Saffsanity#196) were wrong there.
TourFeatures.trackpadMode picks 'The Picture Is a Trackpad': drag to move the pointer, tap to click,
two fingers to right-click and to scroll, hold then drag, and the swipe row as before. tour: 732,453
checks, 129 of 129 mutants (3 new; one pattern made unique).
…picture, and starts it unzoomed (Saffsanity#178)

The trackpad overlay had no recognizer for scroll or hover events, which go to the topmost view, so over
the picture the iPad's trackpad or mouse (and a Mac's, with the iPad app on a Mac) scrolled nothing and
the Mac's pointer stopped following it: TrackpadSurface lets both fall through to the picture's input
view. A zoom made before Trackpad mode could not be pinched back (the trackpad takes two fingers): a
change of mode gives back the whole picture. The tour's DEBUG line names Trackpad mode.

This branch has not been deployed

No deployments
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.

Option to switch between trackpad and mouse mode

1 participant