mirror of
https://github.com/anomalyco/hex.git
synced 2026-11-28 13:02:21 +01:00
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>
15 lines
478 B
Swift
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?()
|
|
}
|
|
}
|