diff options
| author | Maze Winther <mazewinther@gmail.com> | 2025-07-26 12:54:50 +0200 |
|---|---|---|
| committer | Maze Winther <mazewinther@gmail.com> | 2025-07-26 12:54:50 +0200 |
| commit | 6dfc80cd70db08f847d114bdbae582c9983bb83e (patch) | |
| tree | bd5d5fa5fe033d461a8b6c3003bec64451464626 /apps/web/src/hooks/use-keybindings.ts | |
| parent | 043bf7d70abb705059bed5c0dbcc8007448750ec (diff) | |
| download | opencut-6dfc80cd70db08f847d114bdbae582c9983bb83e.tar.gz | |
Merge pull request [#433](https://github.com/mazeincoding/AppCut/issues/433)
Diffstat (limited to 'apps/web/src/hooks/use-keybindings.ts')
| -rw-r--r-- | apps/web/src/hooks/use-keybindings.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/apps/web/src/hooks/use-keybindings.ts b/apps/web/src/hooks/use-keybindings.ts index 7224c1c8..10616900 100644 --- a/apps/web/src/hooks/use-keybindings.ts +++ b/apps/web/src/hooks/use-keybindings.ts @@ -8,13 +8,15 @@ import { useKeybindingsStore } from "@/stores/keybindings-store"; * the appropriate actions based on keybindings */ export function useKeybindingsListener() { - const { keybindings, getKeybindingString, keybindingsEnabled } = + const { keybindings, getKeybindingString, keybindingsEnabled, isRecording } = useKeybindingsStore(); useEffect(() => { const handleKeyDown = (ev: KeyboardEvent) => { // Do not check keybinds if the mode is disabled if (!keybindingsEnabled) return; + // ignore key events if user is changing keybindings + if (isRecording) return; const binding = getKeybindingString(ev); if (!binding) return; @@ -45,7 +47,7 @@ export function useKeybindingsListener() { return () => { document.removeEventListener("keydown", handleKeyDown); }; - }, [keybindings, getKeybindingString, keybindingsEnabled]); + }, [keybindings, getKeybindingString, keybindingsEnabled, isRecording]); } /** |
