mirror of https://github.com/jetkvm/kvm.git
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.
This commit is contained in:
parent
9eb0aa8010
commit
e7a1e225de
|
@ -292,7 +292,7 @@ function KeyboardWrapper() {
|
||||||
],
|
],
|
||||||
}}
|
}}
|
||||||
disableButtonHold={true}
|
disableButtonHold={true}
|
||||||
mergeDisplay={true}
|
syncInstanceInputs={true}
|
||||||
debug={false}
|
debug={false}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
@ -300,34 +300,25 @@ function KeyboardWrapper() {
|
||||||
<Keyboard
|
<Keyboard
|
||||||
baseClass="simple-keyboard-control"
|
baseClass="simple-keyboard-control"
|
||||||
theme="simple-keyboard hg-theme-default hg-layout-default"
|
theme="simple-keyboard hg-theme-default hg-layout-default"
|
||||||
|
layoutName={layoutName}
|
||||||
|
onKeyPress={onKeyDown}
|
||||||
|
display={keyDisplayMap}
|
||||||
layout={{
|
layout={{
|
||||||
default: ["Home Pageup", "Delete End Pagedown"],
|
default: ["Home Pageup", "Delete End Pagedown"],
|
||||||
}}
|
}}
|
||||||
display={{
|
|
||||||
Home: "home",
|
|
||||||
Pageup: "pageup",
|
|
||||||
Delete: "delete",
|
|
||||||
End: "end",
|
|
||||||
Pagedown: "pagedown",
|
|
||||||
}}
|
}}
|
||||||
syncInstanceInputs={true}
|
syncInstanceInputs={true}
|
||||||
onKeyPress={onKeyDown}
|
|
||||||
mergeDisplay={true}
|
|
||||||
debug={false}
|
debug={false}
|
||||||
/>
|
/>
|
||||||
<Keyboard
|
<Keyboard
|
||||||
baseClass="simple-keyboard-arrows"
|
baseClass="simple-keyboard-arrows"
|
||||||
theme="simple-keyboard hg-theme-default hg-layout-default"
|
theme="simple-keyboard hg-theme-default hg-layout-default"
|
||||||
display={{
|
onKeyPress={onKeyDown}
|
||||||
ArrowLeft: "←",
|
display={keyDisplayMap}
|
||||||
ArrowRight: "→",
|
|
||||||
ArrowUp: "↑",
|
|
||||||
ArrowDown: "↓",
|
|
||||||
}}
|
|
||||||
layout={{
|
layout={{
|
||||||
default: ["ArrowUp", "ArrowLeft ArrowDown ArrowRight"],
|
default: ["ArrowUp", "ArrowLeft ArrowDown ArrowRight"],
|
||||||
}}
|
}}
|
||||||
onKeyPress={onKeyDown}
|
syncInstanceInputs={true}
|
||||||
debug={false}
|
debug={false}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -259,22 +259,45 @@ export const keyDisplayMap: Record<string, string> = {
|
||||||
KeyU: "u", KeyV: "v", KeyW: "w", KeyX: "x", KeyY: "y",
|
KeyU: "u", KeyV: "v", KeyW: "w", KeyX: "x", KeyY: "y",
|
||||||
KeyZ: "z",
|
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
|
// Numbers
|
||||||
Digit1: "1", Digit2: "2", Digit3: "3", Digit4: "4", Digit5: "5",
|
Digit1: "1", Digit2: "2", Digit3: "3", Digit4: "4", Digit5: "5",
|
||||||
Digit6: "6", Digit7: "7", Digit8: "8", Digit9: "9", Digit0: "0",
|
Digit6: "6", Digit7: "7", Digit8: "8", Digit9: "9", Digit0: "0",
|
||||||
|
|
||||||
|
// Shifted Numbers
|
||||||
|
"(Digit1)": "!", "(Digit2)": "@", "(Digit3)": "#", "(Digit4)": "$", "(Digit5)": "%",
|
||||||
|
"(Digit6)": "^", "(Digit7)": "&", "(Digit8)": "*", "(Digit9)": "(", "(Digit0)": ")",
|
||||||
|
|
||||||
// Symbols
|
// Symbols
|
||||||
Minus: "-",
|
Minus: "-",
|
||||||
|
"(Minus)": "_",
|
||||||
Equal: "=",
|
Equal: "=",
|
||||||
|
"(Equal)": "+",
|
||||||
BracketLeft: "[",
|
BracketLeft: "[",
|
||||||
|
"(BracketLeft)": "{",
|
||||||
BracketRight: "]",
|
BracketRight: "]",
|
||||||
|
"(BracketRight)": "}",
|
||||||
Backslash: "\\",
|
Backslash: "\\",
|
||||||
|
"(Backslash)": "|",
|
||||||
Semicolon: ";",
|
Semicolon: ";",
|
||||||
|
"(Semicolon)": ":",
|
||||||
Quote: "'",
|
Quote: "'",
|
||||||
|
"(Quote)": "\"",
|
||||||
Comma: ",",
|
Comma: ",",
|
||||||
|
"(Comma)": "<",
|
||||||
Period: ".",
|
Period: ".",
|
||||||
|
"(Period)": ">",
|
||||||
Slash: "/",
|
Slash: "/",
|
||||||
|
"(Slash)": "?",
|
||||||
Backquote: "`",
|
Backquote: "`",
|
||||||
|
"(Backquote)": "~",
|
||||||
IntlBackslash: "\\",
|
IntlBackslash: "\\",
|
||||||
|
|
||||||
// Function keys
|
// Function keys
|
||||||
|
|
Loading…
Reference in New Issue