InputHandler // Reorder when `%quick` inputs are handled.

This commit is contained in:
ShikiSuen 2023-06-19 23:02:36 +08:00
parent 7df892c541
commit 0a711697bb
3 changed files with 3 additions and 18 deletions

View File

@ -151,7 +151,7 @@ extension InputHandler {
}
var index: Int?
let matched: String = [.ofAssociates, .ofInputting].contains(state.type)
let matched: String = [.ofAssociates].contains(state.type)
? input.inputTextIgnoringModifiers ?? "" : input.text
checkSelectionKey: for keyPair in delegate.selectionKeys.enumerated() {
guard matched.lowercased() == keyPair.element.lowercased() else { continue }

View File

@ -216,7 +216,6 @@ extension InputHandler {
var wildcardKey: String { currentLM.cassetteWildcardKey } //
let inputText = input.text
let isWildcardKeyInput: Bool = (inputText == wildcardKey && !wildcardKey.isEmpty)
let calligrapherBackup = calligrapher
let skipStrokeHandling =
input.isReservedKey || input.isNumericPadKey || input.isNonLaptopFunctionKey
@ -286,13 +285,6 @@ extension InputHandler {
}
//
if !currentLM.hasUnigramsFor(keyArray: [calligrapher]) {
// `%quick`
let quickCandidates: Bool = state.type == .ofInputting && state.isCandidateContainer
if quickCandidates, handleCandidate(input: input) {
if !calligrapher.isEmpty { calligrapher = calligrapherBackup }
return true
}
delegate.callError("B49C0979_Cassette語彙庫內無「\(calligrapher)」的匹配記錄。")
calligrapher.removeAll()
//

View File

@ -152,10 +152,8 @@ extension InputHandler {
let hasQuickCandidates: Bool = state.type == .ofInputting && state.isCandidateContainer
if input.modifierFlags == .shift {
// `%quick` Shift
guard !(hasQuickCandidates && handleCandidate(input: input)) else { return true }
}
//
if isHaninKeyboardSymbolMode, [[], .shift].contains(input.modifierFlags) {
@ -164,11 +162,6 @@ extension InputHandler {
return compositionHandled
}
if input.modifierFlags != .shift {
// `%quick` Shift
guard !(hasQuickCandidates && handleCandidate(input: input)) else { return true }
}
// -----
//