Skip to content

Commit

Permalink
[Fix] Alt+key as shortcut may not work properly
Browse files Browse the repository at this point in the history
  • Loading branch information
LEOYoon-Tsaw committed Jun 2, 2024
1 parent accffb8 commit b976930
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sources/SquirrelInputController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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")]")
Expand Down

0 comments on commit b976930

Please sign in to comment.