From c6f03b42fdbc6059ca3a579a83ad4cd4a76d655e Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Thu, 1 Sep 2022 13:42:36 +0800 Subject: [PATCH] ctlIME // Add two static situation marks. --- .../Modules/ControllerModules/ctlInputMethod_Core.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Source/Modules/ControllerModules/ctlInputMethod_Core.swift b/Source/Modules/ControllerModules/ctlInputMethod_Core.swift index c391a875..7bcdb4f1 100644 --- a/Source/Modules/ControllerModules/ctlInputMethod_Core.swift +++ b/Source/Modules/ControllerModules/ctlInputMethod_Core.swift @@ -38,6 +38,10 @@ class ctlInputMethod: IMKInputController { var state: InputStateProtocol = InputState.Empty() /// 當前這個 ctlInputMethod 副本是否處於英數輸入模式。 var isASCIIMode: Bool = false + /// 當前這個 ctlInputMethod 副本是否處於英數輸入模式(滯後項)。 + static var isASCIIModeSituation: Bool = false + /// 當前這個 ctlInputMethod 副本是否處於縱排輸入模式(滯後項)。 + static var isVerticalTypingSituation: Bool = false /// 切換當前 ctlInputMethod 副本的英數輸入模式開關。 func toggleASCIIMode() -> Bool { @@ -201,6 +205,10 @@ class ctlInputMethod: IMKInputController { // 只針對特定類型的 client() 進行處理。 if !(sender is IMKTextInput) { return false } + // 更新此時的靜態狀態標記。 + ctlInputMethod.isASCIIModeSituation = isASCIIMode + ctlInputMethod.isVerticalTypingSituation = isVerticalTyping + // 就這傳入的 NSEvent 都還有可能是 nil,Apple InputMethodKit 團隊到底在搞三小。 guard let event = event else { return false }