diff --git a/ui/src/hooks/useKeyboardLayout.ts b/ui/src/hooks/useKeyboardLayout.ts index 4d4fbcc..d1b1b65 100644 --- a/ui/src/hooks/useKeyboardLayout.ts +++ b/ui/src/hooks/useKeyboardLayout.ts @@ -7,6 +7,12 @@ export function useKeyboardLayout(): { keyboard: KeyboardLayout } { const { keyboardLayout } = useSettingsStore(); const isoCode = useMemo(() => { + // If we don't have a specific layout, default to "en-US" because that was the original layout + // developed so it is a good fallback. Additionally, we replace "en_US" with "en-US" because + // the original server-side code used "en_US" as the default value, but that's not the correct + // ISO code for English/United State. To ensure we remain backward compatible with devices that + // have not had their Keyboard Layout selected by the user, we want to treat "en_US" as if it was + // "en-US" to match the ISO standard codes now used in the keyboardLayouts. console.log("Current keyboard layout from store:", keyboardLayout); if (keyboardLayout && keyboardLayout.length > 0) return keyboardLayout.replace("en_US", "en-US"); @@ -14,7 +20,6 @@ export function useKeyboardLayout(): { keyboard: KeyboardLayout } { }, [keyboardLayout]); const keyboard = useMemo(() => { - console.log("Selected keyboard layout:", isoCode); return selectedKeyboard(isoCode); }, [isoCode]);