From e2bac3eb3242091a5730abb7ff3df27ae1662299 Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Thu, 19 May 2022 08:54:25 +0800 Subject: [PATCH] ctlIME // Extend resetKeyHandler() for specified clients. --- Source/Modules/IMEModules/ctlInputMethod.swift | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Source/Modules/IMEModules/ctlInputMethod.swift b/Source/Modules/IMEModules/ctlInputMethod.swift index fb4a2a33..3433a0a5 100644 --- a/Source/Modules/IMEModules/ctlInputMethod.swift +++ b/Source/Modules/IMEModules/ctlInputMethod.swift @@ -77,9 +77,11 @@ class ctlInputMethod: IMKInputController { // MARK: - KeyHandler Reset Command - func resetKeyHandler() { - if let currentClient = currentClient { - keyHandler.clear() + func resetKeyHandler(client sender: Any? = nil) { + keyHandler.clear() + if let client = sender as? IMKTextInput { + handle(state: InputState.Empty(), client: client) + } else if let currentClient = currentClient { handle(state: InputState.Empty(), client: currentClient) } }