fix keyboard shortcut handling for default shortcuts

This commit is contained in:
Tamius Han 2024-06-06 00:50:58 +02:00
parent 0dbd5b456c
commit ae6575043e

View File

@ -186,17 +186,17 @@ export class KeyboardHandler extends KbmBase {
isActionMatchStandard(shortcut, event) { isActionMatchStandard(shortcut, event) {
return shortcut.key === event.key && return shortcut.key === event.key &&
shortcut.ctrlKey === event.ctrlKey && !!shortcut.ctrlKey === event.ctrlKey &&
shortcut.metaKey === event.metaKey && !!shortcut.metaKey === event.metaKey &&
shortcut.altKey === event.altKey && !!shortcut.altKey === event.altKey &&
shortcut.shiftKey === event.shiftKey !!shortcut.shiftKey === event.shiftKey;
} }
isActionMatchKeyCode(shortcut, event) { isActionMatchKeyCode(shortcut, event) {
return shortcut.code === event.code && return shortcut.code === event.code &&
shortcut.ctrlKey === event.ctrlKey && !!shortcut.ctrlKey === event.ctrlKey &&
shortcut.metaKey === event.metaKey && !!shortcut.metaKey === event.metaKey &&
shortcut.altKey === event.altKey && !!shortcut.altKey === event.altKey &&
shortcut.shiftKey === event.shiftKey !!shortcut.shiftKey === event.shiftKey
} }
isActionMatch(shortcut, event, isLatin = true) { isActionMatch(shortcut, event, isLatin = true) {