Skip to content

Commit

Permalink
Shortcuts: require ctrl/shift state
Browse files Browse the repository at this point in the history
  • Loading branch information
enricoros committed Nov 8, 2023
1 parent e84a9e4 commit fc81265
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/common/components/useGlobalShortcut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const useGlobalShortcut = (shortcutKey: string | undefined, useCtrl: bool
if (!shortcutKey) return;
let lcShortcut = shortcutKey.toLowerCase();
const handleKeyDown = (event: KeyboardEvent) => {
if ((!useCtrl || event.ctrlKey) && (!useShift || event.shiftKey) && event.key.toLowerCase() === lcShortcut) {
if ((useCtrl === event.ctrlKey) && (useShift === event.shiftKey) && event.key.toLowerCase() === lcShortcut) {
event.preventDefault();
event.stopPropagation();
callback();
Expand Down

0 comments on commit fc81265

Please sign in to comment.