From e7a1e225de28118b2e78ee759ec51a2bea42c83a Mon Sep 17 00:00:00 2001 From: Marc Brooks Date: Wed, 14 May 2025 16:10:54 -0500 Subject: [PATCH] fix(ui): Correct virtual keyboard display when shift key is down. Somewhere along the way, the handling of the shift-key state for letters and numbers was lost and we stopped displaying the capital/symbol for the key. Also update page up and page down to have the space in the on-screen key. --- ui/src/components/VirtualKeyboard.tsx | 23 +++++++---------------- ui/src/keyboardMappings.ts | 27 +++++++++++++++++++++++++-- 2 files changed, 32 insertions(+), 18 deletions(-) diff --git a/ui/src/components/VirtualKeyboard.tsx b/ui/src/components/VirtualKeyboard.tsx index d98a5d2..1b20b29 100644 --- a/ui/src/components/VirtualKeyboard.tsx +++ b/ui/src/components/VirtualKeyboard.tsx @@ -292,7 +292,7 @@ function KeyboardWrapper() { ], }} disableButtonHold={true} - mergeDisplay={true} + syncInstanceInputs={true} debug={false} /> @@ -300,34 +300,25 @@ function KeyboardWrapper() { diff --git a/ui/src/keyboardMappings.ts b/ui/src/keyboardMappings.ts index 9ea788a..ee81799 100644 --- a/ui/src/keyboardMappings.ts +++ b/ui/src/keyboardMappings.ts @@ -242,10 +242,10 @@ export const keyDisplayMap: Record = { MetaRight: "meta", Space: " ", Home: "home", - PageUp: "pageup", + PageUp: "page up", Delete: "delete", End: "end", - PageDown: "pagedown", + PageDown: "page down", ArrowLeft: "←", ArrowRight: "→", ArrowUp: "↑", @@ -259,22 +259,45 @@ export const keyDisplayMap: Record = { KeyU: "u", KeyV: "v", KeyW: "w", KeyX: "x", KeyY: "y", KeyZ: "z", + // Capital letters + "(KeyA)": "A", "(KeyB)": "B", "(KeyC)": "C", "(KeyD)": "D", "(KeyE)": "E", + "(KeyF)": "F", "(KeyG)": "G", "(KeyH)": "H", "(KeyI)": "I", "(KeyJ)": "J", + "(KeyK)": "K", "(KeyL)": "L", "(KeyM)": "M", "(KeyN)": "N", "(KeyO)": "O", + "(KeyP)": "P", "(KeyQ)": "Q", "(KeyR)": "R", "(KeyS)": "S", "(KeyT)": "T", + "(KeyU)": "U", "(KeyV)": "V", "(KeyW)": "W", "(KeyX)": "X", "(KeyY)": "Y", + "(KeyZ)": "Z", + // Numbers Digit1: "1", Digit2: "2", Digit3: "3", Digit4: "4", Digit5: "5", Digit6: "6", Digit7: "7", Digit8: "8", Digit9: "9", Digit0: "0", + // Shifted Numbers + "(Digit1)": "!", "(Digit2)": "@", "(Digit3)": "#", "(Digit4)": "$", "(Digit5)": "%", + "(Digit6)": "^", "(Digit7)": "&", "(Digit8)": "*", "(Digit9)": "(", "(Digit0)": ")", + // Symbols Minus: "-", + "(Minus)": "_", Equal: "=", + "(Equal)": "+", BracketLeft: "[", + "(BracketLeft)": "{", BracketRight: "]", + "(BracketRight)": "}", Backslash: "\\", + "(Backslash)": "|", Semicolon: ";", + "(Semicolon)": ":", Quote: "'", + "(Quote)": "\"", Comma: ",", + "(Comma)": "<", Period: ".", + "(Period)": ">", Slash: "/", + "(Slash)": "?", Backquote: "`", + "(Backquote)": "~", IntlBackslash: "\\", // Function keys