From 9a1278073d7f148adc06af92ac0444108d6a5a0c Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Sat, 7 Jan 2023 14:18:42 +0800 Subject: [PATCH] SessionCtl // Stop handling Emacs shortcuts when IMEState.ofEmpty(). --- Source/Modules/SessionCtl_HandleEvent.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/Modules/SessionCtl_HandleEvent.swift b/Source/Modules/SessionCtl_HandleEvent.swift index 0d0712e3..ad99ccb2 100644 --- a/Source/Modules/SessionCtl_HandleEvent.swift +++ b/Source/Modules/SessionCtl_HandleEvent.swift @@ -120,7 +120,9 @@ extension SessionCtl { } // 使 NSEvent 自翻譯,這樣可以讓 Emacs NSEvent 變成標準 NSEvent。 + // 注意不要針對 Empty 空狀態使用這個轉換,否則會使得相關組合鍵第交出垃圾字元。 if eventToDeal.isEmacsKey { + if state.type == .ofEmpty { return false } let verticalProcessing = (state.isCandidateContainer) ? isVerticalCandidateWindow : isVerticalTyping eventToDeal = eventToDeal.convertFromEmacsKeyEvent(isVerticalContext: verticalProcessing) }