hex/ios/HEXShared/FullKeyboard/FullKeyboardEngine+Field.swift
Dax 2d52c720cb
iOS: two-thumb selection on the space bar (experiment, off by default) (#2265)
While the space bar is the trackpad, a second finger can pick a range the
keyboard can't set in the host: each thumb moves one end with its own
TrackpadCursor.State, the strip shows the text with the selected part
highlighted, and both thumbs up offers Delete, Cut, Copy, Dictate and Cancel.
Off, a second finger is ignored exactly as before.

Settings > Experiments > Two-thumb selection, experiments.twoThumbSelection,
off by default.

Idea from @sieversjosua in #2255.

Co-authored-by: Hex <hex@anoma.ly>
2026-11-21 20:44:15 -05:00

15 lines
478 B
Swift

import UIKit
/// The one edit notification: kept beside the engine like the trackpad's own code so
/// `FullKeyboardEngine.swift` stays readable.
@MainActor
extension FullKeyboardEngine {
func didEdit() {
suggestionSpaceBefore = nil
// A key's own edit means a pending Dictate no longer has the field it picked.
trackpadSelectionState.pendingDictation = nil
refreshAutoCapitalization()
refreshSuggestions()
onEdit?()
}
}