KeyParser // Rebranding to InputHandler.
- This change will solve the nomenclatural doubts brought by the previous name change.
This commit is contained in:
parent
d188d6d36c
commit
8fc862714b
|
@ -90,7 +90,7 @@ enum CharCode: UInt /* 16 */ {
|
|||
// ... but only focuses on which physical key is pressed.
|
||||
}
|
||||
|
||||
class keyParser: NSObject {
|
||||
class InputHandler: NSObject {
|
||||
@objc private(set) var useVerticalMode: Bool
|
||||
@objc private(set) var inputText: String?
|
||||
@objc private(set) var inputTextIgnoringModifiers: String?
|
|
@ -26,7 +26,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@class keyParser;
|
||||
@class InputHandler;
|
||||
@class InputState;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
|
|
@ -31,7 +31,7 @@ import Cocoa
|
|||
@objc extension KeyHandler {
|
||||
func _handleCandidateState(
|
||||
_ state: InputState,
|
||||
input: keyParser,
|
||||
input: InputHandler,
|
||||
stateCallback: @escaping (InputState) -> Void,
|
||||
errorCallback: @escaping () -> Void
|
||||
) -> Bool {
|
||||
|
|
|
@ -30,7 +30,7 @@ import Cocoa
|
|||
|
||||
@objc extension KeyHandler {
|
||||
func handle(
|
||||
input: keyParser,
|
||||
input: InputHandler,
|
||||
state: InputState,
|
||||
stateCallback: @escaping (InputState) -> Void,
|
||||
errorCallback: @escaping () -> Void
|
||||
|
|
|
@ -84,7 +84,7 @@ import Cocoa
|
|||
|
||||
func _handleMarkingState(
|
||||
_ state: InputState.Marking,
|
||||
input: keyParser,
|
||||
input: InputHandler,
|
||||
stateCallback: @escaping (InputState) -> Void,
|
||||
errorCallback: @escaping () -> Void
|
||||
) -> Bool {
|
||||
|
@ -455,7 +455,7 @@ import Cocoa
|
|||
|
||||
func _handleForwardWithState(
|
||||
_ state: InputState,
|
||||
input: keyParser,
|
||||
input: InputHandler,
|
||||
stateCallback: @escaping (InputState) -> Void,
|
||||
errorCallback: @escaping () -> Void
|
||||
) -> Bool {
|
||||
|
@ -506,7 +506,7 @@ import Cocoa
|
|||
|
||||
func _handleBackwardWithState(
|
||||
_ state: InputState,
|
||||
input: keyParser,
|
||||
input: InputHandler,
|
||||
stateCallback: @escaping (InputState) -> Void,
|
||||
errorCallback: @escaping () -> Void
|
||||
) -> Bool {
|
||||
|
|
|
@ -53,10 +53,10 @@ class ctlInputMethod: IMKInputController {
|
|||
private var keyHandler: KeyHandler = .init()
|
||||
private var state: InputState = .Empty()
|
||||
|
||||
// 想讓 keyHandler 能夠被外界調查狀態與參數的話,就得對 keyHandler 做常態處理。
|
||||
// 想讓 KeyHandler 能夠被外界調查狀態與參數的話,就得對 KeyHandler 做常態處理。
|
||||
// 這樣 InputState 可以藉由這個 ctlInputMethod 了解到當前的輸入模式是簡體中文還是繁體中文。
|
||||
// 然而,要是直接對 keyHandler 做常態處理的話,反而會導致 keyParser 無法協同處理。
|
||||
// 所以才需要「currentKeyHandler」這個假 keyHandler。
|
||||
// 然而,要是直接對 keyHandler 做常態處理的話,反而會導致 InputHandler 無法協同處理。
|
||||
// 所以才需要「currentKeyHandler」這個假 KeyHandler。
|
||||
// 這個「currentKeyHandler」僅用來讓其他模組知道當前的輸入模式是什麼模式,除此之外別無屌用。
|
||||
static var currentKeyHandler: KeyHandler = .init()
|
||||
@objc static var currentInputMode = mgrPrefs.mostRecentInputMode
|
||||
|
@ -178,7 +178,7 @@ class ctlInputMethod: IMKInputController {
|
|||
IME.areWeUsingOurOwnPhraseEditor = false
|
||||
}
|
||||
|
||||
let input = keyParser(event: event, isVerticalMode: useVerticalMode)
|
||||
let input = InputHandler(event: event, isVerticalMode: useVerticalMode)
|
||||
|
||||
let result = keyHandler.handle(input: input, state: state) { newState in
|
||||
self.handle(state: newState, client: client)
|
||||
|
|
|
@ -97,7 +97,7 @@
|
|||
D41355DE278EA3ED005E5CBD /* UserPhrasesLM.mm in Sources */ = {isa = PBXBuildFile; fileRef = D41355DC278EA3ED005E5CBD /* UserPhrasesLM.mm */; };
|
||||
D427F76C278CA2B0004A2160 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D427F76B278CA1BA004A2160 /* AppDelegate.swift */; };
|
||||
D44FB74D2792189A003C80A6 /* PhraseReplacementMap.mm in Sources */ = {isa = PBXBuildFile; fileRef = D44FB74B2792189A003C80A6 /* PhraseReplacementMap.mm */; };
|
||||
D456576E279E4F7B00DF6BC9 /* KeyParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = D456576D279E4F7B00DF6BC9 /* KeyParser.swift */; };
|
||||
D456576E279E4F7B00DF6BC9 /* InputHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = D456576D279E4F7B00DF6BC9 /* InputHandler.swift */; };
|
||||
D461B792279DAC010070E734 /* InputState.swift in Sources */ = {isa = PBXBuildFile; fileRef = D461B791279DAC010070E734 /* InputState.swift */; };
|
||||
D47B92C027972AD100458394 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = D47B92BF27972AC800458394 /* main.swift */; };
|
||||
D47D73AC27A6CAE600255A50 /* AssociatedPhrases.mm in Sources */ = {isa = PBXBuildFile; fileRef = D47D73AA27A6CAE600255A50 /* AssociatedPhrases.mm */; };
|
||||
|
@ -318,7 +318,7 @@
|
|||
D427F76B278CA1BA004A2160 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = AppDelegate.swift; sourceTree = "<group>"; tabWidth = 2; usesTabs = 1; };
|
||||
D44FB74B2792189A003C80A6 /* PhraseReplacementMap.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = PhraseReplacementMap.mm; sourceTree = "<group>"; tabWidth = 4; usesTabs = 0; };
|
||||
D44FB74C2792189A003C80A6 /* PhraseReplacementMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = PhraseReplacementMap.h; sourceTree = "<group>"; tabWidth = 4; usesTabs = 0; };
|
||||
D456576D279E4F7B00DF6BC9 /* KeyParser.swift */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = KeyParser.swift; sourceTree = "<group>"; tabWidth = 2; usesTabs = 1; };
|
||||
D456576D279E4F7B00DF6BC9 /* InputHandler.swift */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = InputHandler.swift; sourceTree = "<group>"; tabWidth = 2; usesTabs = 1; };
|
||||
D461B791279DAC010070E734 /* InputState.swift */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = InputState.swift; sourceTree = "<group>"; tabWidth = 2; usesTabs = 1; };
|
||||
D47B92BF27972AC800458394 /* main.swift */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = main.swift; sourceTree = "<group>"; tabWidth = 2; usesTabs = 1; };
|
||||
D47D73AA27A6CAE600255A50 /* AssociatedPhrases.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = AssociatedPhrases.mm; sourceTree = "<group>"; tabWidth = 4; usesTabs = 0; };
|
||||
|
@ -429,13 +429,13 @@
|
|||
children = (
|
||||
5B11328827B94CFB00E58451 /* AppleKeyboardConverter.swift */,
|
||||
D461B791279DAC010070E734 /* InputState.swift */,
|
||||
D456576D279E4F7B00DF6BC9 /* InputHandler.swift */,
|
||||
D4E569DA27A34CC100AC2CEF /* KeyHandler.h */,
|
||||
D4E569DB27A34CC100AC2CEF /* KeyHandler.mm */,
|
||||
5B7F225C2808501000DDD3CB /* KeyHandler_HandleInput.swift */,
|
||||
5B782EC3280C243C007276DE /* KeyHandler_HandleCandidate.swift */,
|
||||
5B61B0C9280BEFD4002E3CFA /* KeyHandler_Misc.swift */,
|
||||
5B3133BE280B229700A4A505 /* KeyHandler_States.swift */,
|
||||
D456576D279E4F7B00DF6BC9 /* KeyParser.swift */,
|
||||
6ACC3D3E27914F2400F1B140 /* KeyValueBlobReader.cpp */,
|
||||
6ACC3D3C27914AAB00F1B140 /* KeyValueBlobReader.h */,
|
||||
5B62A33727AE79CD00A19448 /* NSStringUtils.swift */,
|
||||
|
@ -1087,7 +1087,7 @@
|
|||
D47F7DD0278C0897002F9DD7 /* ctlNonModalAlertWindow.swift in Sources */,
|
||||
5B62A32F27AE78B000A19448 /* CoreLM.mm in Sources */,
|
||||
5BE78BE027B38804005EA1BE /* LMConsolidator.mm in Sources */,
|
||||
D456576E279E4F7B00DF6BC9 /* KeyParser.swift in Sources */,
|
||||
D456576E279E4F7B00DF6BC9 /* InputHandler.swift in Sources */,
|
||||
5BA9FD1027FEDB6B002DE248 /* suiPrefPaneKeyboard.swift in Sources */,
|
||||
5B3133BF280B229700A4A505 /* KeyHandler_States.swift in Sources */,
|
||||
5BA9FD4327FEF3C8002DE248 /* Preferences.swift in Sources */,
|
||||
|
|
Loading…
Reference in New Issue