diff --git a/ui/src/components/VirtualKeyboard.tsx b/ui/src/components/VirtualKeyboard.tsx index 8b23d47c..83ebd72f 100644 --- a/ui/src/components/VirtualKeyboard.tsx +++ b/ui/src/components/VirtualKeyboard.tsx @@ -47,7 +47,7 @@ function KeyboardWrapper() { }, [keysDownState]); const isCapsLockActive = useMemo(() => { - return keyboardLedState?.caps_lock || false; + return keyboardLedState.caps_lock; }, [keyboardLedState]); const mainLayoutName = useMemo(() => { diff --git a/ui/src/hooks/stores.ts b/ui/src/hooks/stores.ts index a6dc95b9..a3e05d80 100644 --- a/ui/src/hooks/stores.ts +++ b/ui/src/hooks/stores.ts @@ -463,7 +463,7 @@ export interface HidState { } export const useHidStore = create(set => ({ - keyboardLedState: {} as KeyboardLedState, + keyboardLedState: { num_lock: false, caps_lock: false, scroll_lock: false, compose: false, kana: false, shift: false } as KeyboardLedState, setKeyboardLedState: (ledState: KeyboardLedState): void => set({ keyboardLedState: ledState }), keysDownState: { modifier: 0, keys: [0,0,0,0,0,0] } as KeysDownState,