From ebbd96bc946f96351e770f80a0b80548da5e1a07 Mon Sep 17 00:00:00 2001 From: Leo Vasanko Date: Sat, 18 Nov 2023 07:56:53 -0800 Subject: [PATCH] Global shortcut keys tuning. --- frontend/src/App.vue | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/src/App.vue b/frontend/src/App.vue index c34510e..3471752 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -77,8 +77,8 @@ const globalShortcutHandler = (event: KeyboardEvent) => { // Long if-else machina for all keys we handle here if (event.key === 'ArrowUp') vert = stride * (keyup ? 0 : -1) else if (event.key === 'ArrowDown') vert = stride * (keyup ? 0 : 1) - else if (event.key === 'ArrowLeft') vert = keyup ? 0 : -1 - else if (event.key === 'ArrowRight') vert = keyup ? 0 : 1 + else if (store.gallery && event.key === 'ArrowLeft') vert = keyup ? 0 : -1 + else if (store.gallery && event.key === 'ArrowRight') vert = keyup ? 0 : 1 // Find: process on keydown so that we can bypass the built-in search hotkey else if (!keyup && event.key === 'f' && (event.ctrlKey || event.metaKey)) { headerMain.value!.toggleSearchInput() @@ -89,6 +89,7 @@ const globalShortcutHandler = (event: KeyboardEvent) => { } // Globally close search on Escape else if (keyup && event.key === 'Escape') { + store.error = '' headerMain.value!.closeSearch(event) } // Select all (toggle); keydown to prevent builtin @@ -96,7 +97,7 @@ const globalShortcutHandler = (event: KeyboardEvent) => { fileExplorer.toggleSelectAll() } // G toggles Gallery - else if (keyup && event.key === 'g') { + else if (!input && keyup && event.key === 'g') { store.gallery = !store.gallery } // Keys 1-3 to sort columns