From 02a2683eb0865a273af5d7539a8681433ee14ba9 Mon Sep 17 00:00:00 2001 From: silentoplayz Date: Thu, 23 Oct 2025 05:40:31 -0400 Subject: [PATCH] fix: display correct keys for international keyboards Updates the ShortcutsModal to dynamically display the correct physical keys for users with non-US keyboard layouts. The `ShortcutItem` component now uses `navigator.keyboard.getLayoutMap()` to resolve `KeyboardEvent.code` values (e.g., "Slash") to the character they produce on the user's active keyboard layout (e.g., "-"). This ensures the displayed shortcuts match the keys the user needs to press. A fallback is included for older browsers that do not support this API. --- src/lib/components/chat/ShortcutItem.svelte | 37 +++++++++++++++++---- 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/src/lib/components/chat/ShortcutItem.svelte b/src/lib/components/chat/ShortcutItem.svelte index 494631a984..aaa4dd7de5 100644 --- a/src/lib/components/chat/ShortcutItem.svelte +++ b/src/lib/components/chat/ShortcutItem.svelte @@ -1,5 +1,5 @@