mirror of
https://github.com/anomalyco/hex.git
synced 2026-11-22 21:23:02 +01:00
* iOS keyboard: Korean two-set (두벌식) layout with Hangul composition (experiment, off by default) * iOS keyboard: commit Hangul runs on cursor moves, selections and direct edits * iOS keyboard: keep Hangul runs through delete jitter and trimmed hosts * iOS keyboard: prefer Hex's typing record on lagging hosts * iOS keyboard: keep the engine under the size check after the rebase
24 lines
1 KiB
Swift
24 lines
1 KiB
Swift
import UIKit
|
|
|
|
/// Simulator fixtures (`FullKeyboardSnapshotStage`): a key held down, or its accent callout
|
|
/// open with an option picked.
|
|
extension FullKeyboardView {
|
|
func debugPress(_ character: String) {
|
|
guard let key = engine.layout.key(.character(character)) else { return }
|
|
engine.touchBegan(id: -1, at: CGPoint(x: key.frame.midX, y: key.frame.midY))
|
|
}
|
|
|
|
func debugHoldAccent(_ character: String, selecting option: String) {
|
|
debugHoldAccent(character)
|
|
guard let index = engine.activeAccentMenu?.options.firstIndex(of: option) else { return }
|
|
engine.debugSelectAccent(index)
|
|
}
|
|
|
|
func debugHoldAccent(_ character: String, selectIndex: Int? = nil) {
|
|
guard let key = engine.layout.key(.character(character)) else { return }
|
|
let center = CGPoint(x: key.frame.midX, y: key.frame.midY)
|
|
engine.touchBegan(id: -2, at: center)
|
|
_ = engine.openAccentMenuIfEligible(forTouch: -2)
|
|
if let selectIndex { engine.debugSelectAccent(selectIndex) }
|
|
}
|
|
}
|