From b9769301166ee9bd59646903e255c4f5059aea01 Mon Sep 17 00:00:00 2001 From: LEO Yoon-Tsaw Date: Sun, 2 Jun 2024 13:26:09 -0400 Subject: [PATCH] [Fix] Alt+key as shortcut may not work properly --- sources/SquirrelInputController.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/SquirrelInputController.swift b/sources/SquirrelInputController.swift index 05d2c63e4..4b11979b3 100644 --- a/sources/SquirrelInputController.swift +++ b/sources/SquirrelInputController.swift @@ -97,7 +97,9 @@ final class SquirrelInputController: IMKInputController { let keyCode = event.keyCode var keyChars = event.charactersIgnoringModifiers - if let code = keyChars?.first, !code.isLetter { + let capitalModifiers = modifiers.isSubset(of: [.shift, .capsLock]) + if let code = keyChars?.first, + (capitalModifiers && !code.isLetter) || (!capitalModifiers && !code.isASCII) { keyChars = event.characters } // print("[DEBUG] KEYDOWN client: \(sender ?? "nil"), modifiers: \(modifiers), keyCode: \(keyCode), keyChars: [\(keyChars ?? "empty")]")