From dedc8770cf7470687f7715117015e029e5f2ad97 Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Fri, 24 Jun 2022 15:34:28 +0800 Subject: [PATCH] KeyHandler // Let invalid input pass when the state is Empty. --- .../Modules/ControllerModules/KeyHandler_HandleInput.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/Modules/ControllerModules/KeyHandler_HandleInput.swift b/Source/Modules/ControllerModules/KeyHandler_HandleInput.swift index 519b6e58..78e9ee4e 100644 --- a/Source/Modules/ControllerModules/KeyHandler_HandleInput.swift +++ b/Source/Modules/ControllerModules/KeyHandler_HandleInput.swift @@ -48,6 +48,12 @@ extension KeyHandler { // 提前過濾掉一些不合規的按鍵訊號輸入,免得相關按鍵訊號被送給 Megrez 引發輸入法崩潰。 if input.isInvalidInput { + // 在「.Empty(IgnoringPreviousState) 與 .Deactivated」狀態下的首次不合規按鍵輸入可以直接放行。 + if state is InputState.Empty || state is InputState.Deactivated + || state is InputState.EmptyIgnoringPreviousState + { + return false + } IME.prtDebugIntel("550BCF7B: KeyHandler just refused an invalid input.") errorCallback() stateCallback(state)