This commit is contained in:
Timothy Jaeryang Baek
2025-11-06 13:31:55 -05:00
parent 9c0bd0c0ed
commit d5fe0f6067
2 changed files with 13 additions and 15 deletions
+3 -5
View File
@@ -168,17 +168,15 @@
const isShortcutMatch = (event: KeyboardEvent, shortcut): boolean => {
const keys = shortcut?.keys || [];
const mainKeys = keys.filter(
(k) => !['ctrl', 'Ctrl', 'shift', 'Shift', 'alt', 'Alt', 'mod', 'Mod'].includes(k)
);
const normalized = keys.map((k) => k.toLowerCase());
const needCtrl = normalized.includes('ctrl') || normalized.includes('mod');
const needShift = normalized.includes('shift');
const needAlt = normalized.includes('alt');
const mainKeys = normalized.filter((k) => !['ctrl', 'shift', 'alt', 'mod'].includes(k));
// Get the main key pressed
const keyPressed = event.code;
const keyPressed = event.key.toLowerCase();
// Check modifiers
if (needShift && !event.shiftKey) return false;