From 98d3b99c8b07e2639a0a6b99e1e3456a48ece879 Mon Sep 17 00:00:00 2001 From: iain MacDonnell Date: Fri, 20 Jun 2025 09:42:22 +0000 Subject: [PATCH] fix: keyboard_layout default config (en-US/en_US) Use correct format in default config, and also correct code change from #512 Fixes: #632 --- config.go | 2 +- ui/src/components/popovers/PasteModal.tsx | 4 ++-- ui/src/routes/devices.$id.settings.keyboard.tsx | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/config.go b/config.go index 04f2a4e..3e88457 100644 --- a/config.go +++ b/config.go @@ -111,7 +111,7 @@ var defaultConfig = &Config{ ActiveExtension: "", KeyboardMacros: []KeyboardMacro{}, DisplayRotation: "270", - KeyboardLayout: "en-US", + KeyboardLayout: "en_US", DisplayMaxBrightness: 64, DisplayDimAfterSec: 120, // 2 minutes DisplayOffAfterSec: 1800, // 30 minutes diff --git a/ui/src/components/popovers/PasteModal.tsx b/ui/src/components/popovers/PasteModal.tsx index ed642a8..8103edd 100644 --- a/ui/src/components/popovers/PasteModal.tsx +++ b/ui/src/components/popovers/PasteModal.tsx @@ -39,11 +39,11 @@ export default function PasteModal() { state => state.setKeyboardLayout, ); - // this ensures we always get the original en-US if it hasn't been set yet + // this ensures we always get the original en_US if it hasn't been set yet const safeKeyboardLayout = useMemo(() => { if (keyboardLayout && keyboardLayout.length > 0) return keyboardLayout; - return "en-US"; + return "en_US"; }, [keyboardLayout]); useEffect(() => { diff --git a/ui/src/routes/devices.$id.settings.keyboard.tsx b/ui/src/routes/devices.$id.settings.keyboard.tsx index 12ed6f2..6e68f81 100644 --- a/ui/src/routes/devices.$id.settings.keyboard.tsx +++ b/ui/src/routes/devices.$id.settings.keyboard.tsx @@ -25,11 +25,11 @@ export default function SettingsKeyboardRoute() { state => state.setShowPressedKeys, ); - // this ensures we always get the original en-US if it hasn't been set yet + // this ensures we always get the original en_US if it hasn't been set yet const safeKeyboardLayout = useMemo(() => { if (keyboardLayout && keyboardLayout.length > 0) return keyboardLayout; - return "en-US"; + return "en_US"; }, [keyboardLayout]); const layoutOptions = Object.entries(layouts).map(([code, language]) => { return { value: code, label: language } })