From acdde919ef582e88f0ea3d24b36d96e28b85e9c5 Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Mon, 13 Feb 2023 12:35:58 +0800 Subject: [PATCH] InputHandler // Change non-default behavior of the Esc key. --- Source/Modules/InputHandler_HandleStates.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Source/Modules/InputHandler_HandleStates.swift b/Source/Modules/InputHandler_HandleStates.swift index 168ff99c..ccfd2d66 100644 --- a/Source/Modules/InputHandler_HandleStates.swift +++ b/Source/Modules/InputHandler_HandleStates.swift @@ -584,7 +584,11 @@ extension InputHandler { /// 此乃 macOS 內建注音輸入法預設之行為,但不太受 Windows 使用者群體之待見。 delegate.switchState(IMEState.ofAbortion()) } else { - if isComposerOrCalligrapherEmpty { return true } + if isComposerOrCalligrapherEmpty { + let commitText = generateStateOfInputting(sansReading: true).displayedText + delegate.switchState(IMEState.ofCommitting(textToCommit: commitText)) + return true + } /// 如果注拼槽或組筆區不是空的話,則清空之。 clearComposerAndCalligrapher() switch compositor.isEmpty {