InputHandler // Extend upperCaseLetterKeyBehavior().
This commit is contained in:
parent
c2ea8f254d
commit
e4be1ecd3d
|
@ -255,22 +255,26 @@ extension InputHandler {
|
||||||
if input.isUpperCaseASCIILetterKey, !input.isCommandHold, !input.isControlHold {
|
if input.isUpperCaseASCIILetterKey, !input.isCommandHold, !input.isControlHold {
|
||||||
if input.isShiftHold { // 這裡先不要判斷 isOptionHold。
|
if input.isShiftHold { // 這裡先不要判斷 isOptionHold。
|
||||||
switch prefs.upperCaseLetterKeyBehavior {
|
switch prefs.upperCaseLetterKeyBehavior {
|
||||||
case 1:
|
case 1, 3:
|
||||||
delegate.switchState(IMEState.ofEmpty())
|
if prefs.upperCaseLetterKeyBehavior == 3, !isConsideredEmptyForNow { break }
|
||||||
delegate.switchState(IMEState.ofCommitting(textToCommit: inputText.lowercased()))
|
let commitText = generateStateOfInputting(sansReading: true).displayedText
|
||||||
|
delegate.switchState(IMEState.ofCommitting(textToCommit: commitText + inputText.lowercased()))
|
||||||
return true
|
return true
|
||||||
case 2:
|
case 2, 4:
|
||||||
delegate.switchState(IMEState.ofEmpty())
|
if prefs.upperCaseLetterKeyBehavior == 4, !isConsideredEmptyForNow { break }
|
||||||
delegate.switchState(IMEState.ofCommitting(textToCommit: inputText.uppercased()))
|
let commitText = generateStateOfInputting(sansReading: true).displayedText
|
||||||
|
delegate.switchState(IMEState.ofCommitting(textToCommit: commitText + inputText.uppercased()))
|
||||||
return true
|
return true
|
||||||
default: // 包括 case 0,直接塞給組字區。
|
default: // 包括 case 0。
|
||||||
|
break
|
||||||
|
}
|
||||||
|
// 直接塞給組字區。
|
||||||
let letter = "_letter_\(inputText)"
|
let letter = "_letter_\(inputText)"
|
||||||
if handlePunctuation(letter) {
|
if handlePunctuation(letter) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// MARK: - 終末處理 (Still Nothing)
|
// MARK: - 終末處理 (Still Nothing)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue