From 590210ada91f03f787676c807a2ec6924f5dacd7 Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Sat, 20 Aug 2022 13:50:10 +0800 Subject: [PATCH] ctlIME // Auto-convert NumPad keyCodes for IMKCandidates. --- Source/Modules/ControllerModules/ctlInputMethod_Core.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/Modules/ControllerModules/ctlInputMethod_Core.swift b/Source/Modules/ControllerModules/ctlInputMethod_Core.swift index 931324f8..204cba63 100644 --- a/Source/Modules/ControllerModules/ctlInputMethod_Core.swift +++ b/Source/Modules/ControllerModules/ctlInputMethod_Core.swift @@ -211,6 +211,7 @@ class ctlInputMethod: IMKInputController { // - 是就地交給 super.interpretKeyEvents() 處理? // - 還是藉由 delegate 扔回 ctlInputMethod 給 KeyHandler 處理? if let ctlCandidateCurrent = ctlInputMethod.ctlCandidateCurrent as? ctlCandidateIMK, ctlCandidateCurrent.visible { + let event: NSEvent! = ctlCandidateIMK.replaceNumPadKeyCodes(target: event) ?? event let input = InputSignal(event: event) // Shift+Enter 是個特殊情形,不提前攔截處理的話、會有垃圾參數傳給 delegate 的 keyHandler 從而崩潰。 // 所以這裡直接將 Shift Flags 清空。