From 45925c3263926e6567c9b0e416249ea1d5eed0cf Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Wed, 28 Jun 2023 00:25:45 +0800 Subject: [PATCH] InputHandler // Still block leading letter-type wildcardKey. --- Source/Modules/InputHandler_HandleComposition.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Source/Modules/InputHandler_HandleComposition.swift b/Source/Modules/InputHandler_HandleComposition.swift index 756a4348..96a724cd 100644 --- a/Source/Modules/InputHandler_HandleComposition.swift +++ b/Source/Modules/InputHandler_HandleComposition.swift @@ -256,6 +256,14 @@ extension InputHandler { prehandling: if !skipStrokeHandling && currentLM.isThisCassetteKeyAllowed(key: inputText) { if calligrapher.isEmpty, isWildcardKeyInput { delegate.callError("3606B9C0") + if input.beganWithLetter { + var newEmptyState = compositor.isEmpty ? IMEState.ofEmpty() : generateStateOfInputting() + newEmptyState.tooltip = NSLocalizedString("Wildcard key cannot be the initial key.", comment: "") + newEmptyState.data.tooltipColorState = .redAlert + newEmptyState.tooltipDuration = 1.0 + delegate.switchState(newEmptyState) + return true + } delegate.callNotification(NSLocalizedString("Wildcard key cannot be the initial key.", comment: "")) return nil }