hex/ios/docs
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Ryan Vogel 56138e7b7a iOS: the space-bar trackpad moves like Apple's
What changed
- The trackpad drags a point through the text at the text's own scale, in two
  dimensions, and puts the cursor at the nearest position (TrackpadCursor.State),
  as Apple's does. The text the field shares is laid out with the body font's own
  character widths, rows wrapped at the keyboard width less 40 pt, 20 pt lines.
- Gain follows the finger's speed like Apple's: 1x slowly, 1.4x at 400 pt/s, 2x at
  1,000, 2.6x at 2,000 (TrackpadCursor.gain), from a windowed speed of the touch's
  own timestamps, the same up, down or slanting.
- Lines: one per line height (the first after half a line), x kept across short
  lines; it stops at a line's start and end and at the first/last line. Replaces
  the fixed 7.5 pt per character and 15.5 pt per line, and the move on past a line
  end into the next line.
- Hosts share only the cursor's sentence/line (UITextView: "Lin" | "e two is a bit
  longer"), and drop a move that would leave the text (moves sent together add
  up). So at the edge of what's known the cursor waits for the host to show more,
  and past the first/last known line it steps just past it in one move, which the
  host makes only if text is there; no answer in 100 ms means it never moved.
  Before, moving down past the current line did nothing.
- Offsets are UTF-16 (the proxy's unit): a 👍🏽 is one step, not four (three of
  them stalled inside the emoji).
- Keys blank to keycaps 60% of the way to the backdrop (Apple: 242,242,247 on
  226,227,232 light, 54 on 32 dark); Hex kept white keycaps.
- No haptic on start or per character (Apple's keyboard asks for no feedback after
  the space bar's own); a second finger while the trackpad is on types nothing
  (it typed the blank key under it). Selection stays impossible:
  UITextDocumentProxy can't set one.
- Trackpad code moved to FullKeyboardEngine+Trackpad.swift; FullKeyboardEngine.swift
  is 1,476 lines.

Verified
- Apple black box, iOS 27.2 simulator, same scripted HID gestures on Apple's,
  origin/dev and this build (UITextView logging selectedRange): 80 pt right at
  150/400/1,000/2,000 pt/s gave 11/13/21/26 characters on Apple's, 10/10/10/10
  before, 11/13/20/26 now; 140 pt down from line 1 reached line 5 on Apple's and
  now, nothing before; up 40 pt in 40 ms: 4 lines on both (before 3); 100 pt past
  a line end stops at it on both (before ran into the next line); column kept up
  8 lines (index 7 on both).
- Independent check (coordinator, iPhone 15 Pro / iOS 27.2 simulator, native
  UITextView, matched HID): build 56 up stays line 8 / down stays 5 / right moves 4;
  build 110 (19747178) up 8->6 / down stays 5 / right 4; this candidate up 8->6 /
  down 5->6 / right moves one, no text edits.
- xcodebuild test: 624 tests, 0 failures, 1 skipped; after rebasing on dev
  3f374f42, FullKeyboardEngineTests' 118 pass.
2026-11-21 13:22:31 -05:00
..
typing-logs.md iOS: the space-bar trackpad moves like Apple's 2026-11-21 13:22:31 -05:00