Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions ui/src/components/VirtualKeyboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,10 @@ function KeyboardWrapper() {
<Card
className={cx("overflow-hidden", {
"rounded-none": isAttachedVirtualKeyboardVisible,
"keyboard-detached": !isAttachedVirtualKeyboardVisible
})}
>
<div className="flex items-center justify-center border-b border-b-slate-800/30 bg-white px-2 py-1 dark:border-b-slate-300/20 dark:bg-slate-800">
<div className="flex items-center justify-center border-b border-b-slate-800/30 bg-white px-2 py-4 dark:border-b-slate-300/20 dark:bg-slate-800">
<div className="absolute left-2 flex items-center gap-x-2">
{isAttachedVirtualKeyboardVisible ? (
<Button
Expand All @@ -246,7 +247,7 @@ function KeyboardWrapper() {
)}
</div>
<h2 className="select-none self-center font-sans text-[12px] text-slate-700 dark:text-slate-300">
Virtual Keyboard
Virtual Keyboard<span className="text-[10px]"> - {selectedKeyboard.name}</span>
</h2>
<div className="absolute right-2">
<Button
Expand Down
14 changes: 14 additions & 0 deletions ui/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,20 @@ video::-webkit-media-controls {
@apply mr-[2px]! md:mr-[5px]!;
}

/* Reduce font size for selected keys when keyboard is detached */
.keyboard-detached .simple-keyboard-main.simple-keyboard {
min-width: calc(14 * 7ch);
}

.keyboard-detached .simple-keyboard.hg-theme-default div.hg-button {
text-wrap: auto;
text-align: center;
min-width: 6ch;
}
.keyboard-detached .simple-keyboard.hg-theme-default .hg-button span {
font-size: 50%;
}

/* Hide the scrollbar by setting the scrollbar color to the background color */
.xterm .xterm-viewport {
scrollbar-color: var(--color-gray-900) #002b36;
Expand Down
22 changes: 11 additions & 11 deletions ui/src/keyboardLayouts/en_US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,33 +144,33 @@ export const keyDisplayMap: Record<string, string> = {
AltMetaEscape: "Alt + Meta + Escape",
CtrlAltBackspace: "Ctrl + Alt + Backspace",
AltGr: "AltGr",
AltLeft: "Alt",
AltRight: "Alt",
AltLeft: "Alt",
AltRight: "Alt",
ArrowDown: "↓",
ArrowLeft: "←",
ArrowRight: "→",
ArrowUp: "↑",
Backspace: "Backspace",
"(Backspace)": "Backspace",
CapsLock: "Caps Lock",
CapsLock: "Caps Lock",
Clear: "Clear",
ControlLeft: "Ctrl",
ControlRight: "Ctrl",
Delete: "Delete",
ControlLeft: "Ctrl",
ControlRight: "Ctrl",
Delete: "Delete",
End: "End",
Enter: "Enter",
Escape: "Esc",
Home: "Home",
Insert: "Insert",
Menu: "Menu",
MetaLeft: "Meta",
MetaRight: "Meta",
MetaLeft: "Meta",
MetaRight: "Meta",
PageDown: "PgDn",
PageUp: "PgUp",
ShiftLeft: "Shift",
ShiftRight: "Shift",
ShiftLeft: "Shift",
ShiftRight: "Shift",
Space: " ",
Tab: "Tab",
Tab: "Tab",

// Letters
KeyA: "a", KeyB: "b", KeyC: "c", KeyD: "d", KeyE: "e",
Expand Down
28 changes: 14 additions & 14 deletions ui/src/keyboardMappings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,6 @@ export const keys = {
Help: 0x75,
Home: 0x4a,
Insert: 0x49,
International1: 0x87,
International2: 0x88,
International3: 0x89,
International4: 0x8a,
International5: 0x8b,
International6: 0x8c,
International7: 0x8d,
International8: 0x8e,
International9: 0x8f,
Expand Down Expand Up @@ -117,14 +111,20 @@ export const keys = {
KeyX: 0x1b,
KeyY: 0x1c,
KeyZ: 0x1d,
KeyRO: 0x87,
KatakanaHiragana: 0x88,
Yen: 0x89,
Henkan: 0x8a,
Muhenkan: 0x8b,
KPJPComma: 0x8c,
Hangeul: 0x90,
Hanja: 0x91,
Katakana: 0x92,
Hiragana: 0x93,
ZenkakuHankaku:0x94,
LockingCapsLock: 0x82,
LockingNumLock: 0x83,
LockingScrollLock: 0x84,
Lang1: 0x90, // Hangul/English toggle on Korean keyboards
Lang2: 0x91, // Hanja conversion on Korean keyboards
Lang3: 0x92, // Katakana on Japanese keyboards
Lang4: 0x93, // Hiragana on Japanese keyboards
Lang5: 0x94, // Zenkaku/Hankaku toggle on Japanese keyboards
Lang6: 0x95,
Lang7: 0x96,
Lang8: 0x97,
Expand Down Expand Up @@ -157,7 +157,7 @@ export const keys = {
NumpadClearEntry: 0xd9,
NumpadColon: 0xcb,
NumpadComma: 0x85,
NumpadDecimal: 0x63,
NumpadDecimal: 0x63, // and Delete
NumpadDecimalBase: 0xdc,
NumpadDelete: 0x63,
NumpadDivide: 0x54,
Expand Down Expand Up @@ -211,7 +211,7 @@ export const keys = {
PageUp: 0x4b,
Paste: 0x7d,
Pause: 0x48,
Period: 0x37,
Period: 0x37, // aka Dot
Power: 0x66,
PrintScreen: 0x46,
Prior: 0x9d,
Expand All @@ -226,7 +226,7 @@ export const keys = {
Slash: 0x38,
Space: 0x2c,
Stop: 0x78,
SystemRequest: 0x9a,
SystemRequest: 0x9a, // aka Attention
Tab: 0x2b,
ThousandsSeparator: 0xb2,
Tilde: 0x35,
Expand Down
4 changes: 2 additions & 2 deletions ui/src/routes/devices.$id.settings.keyboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export default function SettingsKeyboardRoute() {

<div className="space-y-4">
<SettingsItem
title="Paste text"
title="Keyboard Layout"
description="Keyboard layout of target operating system"
>
<SelectMenuBasic
Expand All @@ -66,7 +66,7 @@ export default function SettingsKeyboardRoute() {
/>
</SettingsItem>
<p className="text-xs text-slate-600 dark:text-slate-400">
Pasting text sends individual key strokes to the target device. The keyboard layout determines which key codes are being sent. Ensure that the keyboard layout in JetKVM matches the settings in the operating system.
The virtual keyboard, paste text, and keyboard macros send individual key strokes to the target device. The keyboard layout determines which key codes are being sent. Ensure that the keyboard layout in JetKVM matches the settings in the operating system.
</p>
</div>

Expand Down