diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 5bac627..54ecd38 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -119,8 +119,12 @@ const globalShortcutHandler = (event: KeyboardEvent) => { else if (!keyup && event.key === 'f' && (event.ctrlKey || event.metaKey)) { headerMain.value!.toggleSearchInput() } - // Search also on / (UNIX style) - else if (!input && keyup && event.key === '/') { + // Search also on / (UNIX style) - use code to support any keyboard layout + else if (!input && keyup && event.code === 'Slash') { + // Record the actual character for display (varies by keyboard layout) + if (event.key.length === 1 && event.key !== store.prefs.searchHotkey) { + store.prefs.searchHotkey = event.key + } headerMain.value!.toggleSearchInput() } // Globally close search, clear errors on Escape @@ -170,7 +174,7 @@ const globalShortcutHandler = (event: KeyboardEvent) => { if (arrow && !keyup) { const focusSearch = () => (document.querySelector('.headermain input[type="search"]') as HTMLElement)?.focus() const focusBreadcrumb = () => (document.querySelector('.breadcrumb') as HTMLElement)?.focus() - + if (inBreadcrumb) { // Breadcrumb: up→header (no repeat), down→files (with repeat) if (arrow === 'up') { focusSearch(); f = null } diff --git a/frontend/src/components/HeaderMain.vue b/frontend/src/components/HeaderMain.vue index 14791ef..42495d7 100644 --- a/frontend/src/components/HeaderMain.vue +++ b/frontend/src/components/HeaderMain.vue @@ -17,7 +17,7 @@ @input="updateSearch" @keydown.escape="clearSearch" /> - / + {{ store.prefs.searchHotkey }}
diff --git a/frontend/src/stores/main.ts b/frontend/src/stores/main.ts index 01f917b..0266d74 100644 --- a/frontend/src/stores/main.ts +++ b/frontend/src/stores/main.ts @@ -87,6 +87,7 @@ export const useMainStore = defineStore('main', { gallery: false, sortListing: '' as SortOrder, sortFiltered: '' as SortOrder, + searchHotkey: '/', // Character shown for search hotkey (Slash key) }, user: { username: '' as string,