InputHandler // +useSpaceToCommitHighlightedSCPCCandidate().
This commit is contained in:
parent
e8cd2ebb8f
commit
45c8620c01
|
@ -106,6 +106,10 @@ extension InputHandler {
|
||||||
_ = updated ? {}() : delegate.callError("9B691919")
|
_ = updated ? {}() : delegate.callError("9B691919")
|
||||||
return true
|
return true
|
||||||
case .kSpace where state.type != .ofInputting:
|
case .kSpace where state.type != .ofInputting:
|
||||||
|
guard !(prefs.useSpaceToCommitHighlightedSCPCCandidate && prefs.useSCPCTypingMode) else {
|
||||||
|
delegate.candidateSelectionConfirmedByInputHandler(at: ctlCandidate.highlightedIndex)
|
||||||
|
return true
|
||||||
|
}
|
||||||
let updated: Bool =
|
let updated: Bool =
|
||||||
prefs.specifyShiftSpaceKeyBehavior
|
prefs.specifyShiftSpaceKeyBehavior
|
||||||
? (input.isShiftHold
|
? (input.isShiftHold
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
/// 該檔案乃輸入調度模組當中用來預處理 NSEvent 的模組。
|
/// 該檔案乃輸入調度模組當中用來預處理 NSEvent 的模組。
|
||||||
|
|
||||||
|
import CocoaExtension
|
||||||
import InputMethodKit
|
import InputMethodKit
|
||||||
import Shared
|
import Shared
|
||||||
|
|
||||||
|
@ -99,6 +100,18 @@ extension InputHandler {
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
} else if event.isSpace {
|
} else if event.isSpace {
|
||||||
|
if prefs.useSpaceToCommitHighlightedSCPCCandidate, prefs.useSCPCTypingMode,
|
||||||
|
let eventTranslated = event.reinitiate(keyCode: KeyCode.kCarriageReturn.rawValue)
|
||||||
|
{
|
||||||
|
if #available(macOS 10.14, *) {
|
||||||
|
PrefMgr.shared.failureFlagForIMKCandidates = true
|
||||||
|
imkC.handleKeyboardEvent(eventTranslated)
|
||||||
|
PrefMgr.shared.failureFlagForIMKCandidates = false
|
||||||
|
} else {
|
||||||
|
imkC.interpretKeyEvents([eventTranslated])
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
switch prefs.specifyShiftSpaceKeyBehavior {
|
switch prefs.specifyShiftSpaceKeyBehavior {
|
||||||
case true: _ = event.isShiftHold ? imkC.highlightNextCandidate() : imkC.showNextPage()
|
case true: _ = event.isShiftHold ? imkC.highlightNextCandidate() : imkC.showNextPage()
|
||||||
case false: _ = event.isShiftHold ? imkC.showNextPage() : imkC.highlightNextCandidate()
|
case false: _ = event.isShiftHold ? imkC.showNextPage() : imkC.highlightNextCandidate()
|
||||||
|
|
Loading…
Reference in New Issue