diff --git a/Source/Modules/InputHandler_HandleInput.swift b/Source/Modules/InputHandler_HandleInput.swift index 1aea2887..18494529 100644 --- a/Source/Modules/InputHandler_HandleInput.swift +++ b/Source/Modules/InputHandler_HandleInput.swift @@ -277,14 +277,6 @@ extension InputHandler { return true } - // 將 Apple 動態鍵盤佈局的 RAW 輸出轉為 ABC 輸出。僅對磁帶模式啟用此步驟。 - if IMKHelper.isDynamicBasicKeyboardLayoutEnabled, let event = input as? NSEvent, - prefs.cassetteEnabled, let txtABC = event.inAppleABCStaticForm.characters, !txtABC.isEmpty - { - delegate.switchState(IMEState.ofCommitting(textToCommit: txtABC)) - return true - } - return false } } diff --git a/Source/Modules/SessionCtl_HandleEvent.swift b/Source/Modules/SessionCtl_HandleEvent.swift index 379151a9..c0c95793 100644 --- a/Source/Modules/SessionCtl_HandleEvent.swift +++ b/Source/Modules/SessionCtl_HandleEvent.swift @@ -136,10 +136,15 @@ extension SessionCtl { if shouldUseShiftToggleHandle { rencentKeyHandledByInputHandlerEtc = result } if !result { // 除非是 .ofMarking 狀態,否則讓某些不用去抓的按鍵起到「取消工具提示」的作用。 - if [.ofEmpty].contains(state.type) { - tooltipInstance.hide() + if [.ofEmpty].contains(state.type) { tooltipInstance.hide() } + + // 將 Apple 動態鍵盤佈局的 RAW 輸出轉為 ABC 輸出,除非轉換結果與轉換前的內容一致。 + if IMKHelper.isDynamicBasicKeyboardLayoutEnabled, event.text != eventToDeal.text { + switchState(IMEState.ofCommitting(textToCommit: eventToDeal.text)) + return true } } + return result } }