From 73447e693cc2bc85c92be2dab088dddb6d091533 Mon Sep 17 00:00:00 2001 From: Ivan Necheporenko <63012530+ivan-necheporenko@users.noreply.github.com> Date: Thu, 3 Dec 2026 21:36:01 +0100 Subject: [PATCH] Add Ukrainian keyboard layout Based on the Windows "Ukrainian (Enhanced)" layout, as in jetkvm/kvm#1843. --- frontend/jetkvm-ui/src/keyboardLayouts.ts | 2 + .../jetkvm-ui/src/keyboardLayouts/uk_UA.ts | 215 ++++++++++++++++++ 2 files changed, 217 insertions(+) create mode 100644 frontend/jetkvm-ui/src/keyboardLayouts/uk_UA.ts diff --git a/frontend/jetkvm-ui/src/keyboardLayouts.ts b/frontend/jetkvm-ui/src/keyboardLayouts.ts index 5dd9e15b..cb9bb5fc 100644 --- a/frontend/jetkvm-ui/src/keyboardLayouts.ts +++ b/frontend/jetkvm-ui/src/keyboardLayouts.ts @@ -44,6 +44,7 @@ import { pt_PT } from "@/keyboardLayouts/pt_PT"; import { sv_SE } from "@/keyboardLayouts/sv_SE"; import { sl_SI } from "@/keyboardLayouts/sl_SI"; import { ru_RU } from "@/keyboardLayouts/ru_RU"; +import { uk_UA } from "@/keyboardLayouts/uk_UA"; export const keyboards: KeyboardLayout[] = [ cs_CZ, @@ -65,4 +66,5 @@ export const keyboards: KeyboardLayout[] = [ sv_SE, sl_SI, ru_RU, + uk_UA, ]; diff --git a/frontend/jetkvm-ui/src/keyboardLayouts/uk_UA.ts b/frontend/jetkvm-ui/src/keyboardLayouts/uk_UA.ts new file mode 100644 index 00000000..e52ab0c9 --- /dev/null +++ b/frontend/jetkvm-ui/src/keyboardLayouts/uk_UA.ts @@ -0,0 +1,215 @@ +import { KeyboardLayout, KeyCombo } from "../keyboardLayouts"; +import { en_US } from "./en_US"; + +// Windows "Ukrainian (Enhanced)" (KBDUR1) +const name = "Українська"; +const isoCode = "uk-UA"; + +const unchangedFromUS = [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "!", + "%", + "*", + "(", + ")", + "-", + "_", + "=", + "+", + "\\", + " ", + "\n", + "Enter", + "Escape", + "Tab", + "PrintScreen", + "SystemRequest", + "ScrollLock", + "Pause", + "Break", + "Insert", + "Delete", +]; + +export const chars = { + ...Object.fromEntries( + unchangedFromUS.map((char) => [char, en_US.chars[char]]), + ), + й: { key: "KeyQ" }, + ц: { key: "KeyW" }, + у: { key: "KeyE" }, + к: { key: "KeyR" }, + е: { key: "KeyT" }, + н: { key: "KeyY" }, + г: { key: "KeyU" }, + ш: { key: "KeyI" }, + щ: { key: "KeyO" }, + з: { key: "KeyP" }, + х: { key: "BracketLeft" }, + ї: { key: "BracketRight" }, + ф: { key: "KeyA" }, + і: { key: "KeyS" }, + в: { key: "KeyD" }, + а: { key: "KeyF" }, + п: { key: "KeyG" }, + р: { key: "KeyH" }, + о: { key: "KeyJ" }, + л: { key: "KeyK" }, + д: { key: "KeyL" }, + ж: { key: "Semicolon" }, + є: { key: "Quote" }, + я: { key: "KeyZ" }, + ч: { key: "KeyX" }, + с: { key: "KeyC" }, + м: { key: "KeyV" }, + и: { key: "KeyB" }, + т: { key: "KeyN" }, + ь: { key: "KeyM" }, + б: { key: "Comma" }, + ю: { key: "Period" }, + ґ: { key: "KeyU", altRight: true }, + Й: { key: "KeyQ", shift: true }, + Ц: { key: "KeyW", shift: true }, + У: { key: "KeyE", shift: true }, + К: { key: "KeyR", shift: true }, + Е: { key: "KeyT", shift: true }, + Н: { key: "KeyY", shift: true }, + Г: { key: "KeyU", shift: true }, + Ш: { key: "KeyI", shift: true }, + Щ: { key: "KeyO", shift: true }, + З: { key: "KeyP", shift: true }, + Х: { key: "BracketLeft", shift: true }, + Ї: { key: "BracketRight", shift: true }, + Ф: { key: "KeyA", shift: true }, + І: { key: "KeyS", shift: true }, + В: { key: "KeyD", shift: true }, + А: { key: "KeyF", shift: true }, + П: { key: "KeyG", shift: true }, + Р: { key: "KeyH", shift: true }, + О: { key: "KeyJ", shift: true }, + Л: { key: "KeyK", shift: true }, + Д: { key: "KeyL", shift: true }, + Ж: { key: "Semicolon", shift: true }, + Є: { key: "Quote", shift: true }, + Я: { key: "KeyZ", shift: true }, + Ч: { key: "KeyX", shift: true }, + С: { key: "KeyC", shift: true }, + М: { key: "KeyV", shift: true }, + И: { key: "KeyB", shift: true }, + Т: { key: "KeyN", shift: true }, + Ь: { key: "KeyM", shift: true }, + Б: { key: "Comma", shift: true }, + Ю: { key: "Period", shift: true }, + Ґ: { key: "KeyU", shift: true, altRight: true }, + "'": { key: "Backquote" }, + "₴": { key: "Backquote", shift: true }, + '"': { key: "Digit2", shift: true }, + "№": { key: "Digit3", shift: true }, + ";": { key: "Digit4", shift: true }, + ":": { key: "Digit6", shift: true }, + "?": { key: "Digit7", shift: true }, + "/": { key: "Backslash", shift: true }, + ".": { key: "Slash" }, + ",": { key: "Slash", shift: true }, +} as Record; + +export const keyDisplayMap = { + ...en_US.keyDisplayMap, + KeyQ: "й", + KeyW: "ц", + KeyE: "у", + KeyR: "к", + KeyT: "е", + KeyY: "н", + KeyU: "г", + KeyI: "ш", + KeyO: "щ", + KeyP: "з", + BracketLeft: "х", + BracketRight: "ї", + KeyA: "ф", + KeyS: "і", + KeyD: "в", + KeyF: "а", + KeyG: "п", + KeyH: "р", + KeyJ: "о", + KeyK: "л", + KeyL: "д", + Semicolon: "ж", + Quote: "є", + KeyZ: "я", + KeyX: "ч", + KeyC: "с", + KeyV: "м", + KeyB: "и", + KeyN: "т", + KeyM: "ь", + Comma: "б", + Period: "ю", + IntlBackslash: "ґ", + Backquote: "'", + Slash: ".", + "(KeyQ)": "Й", + "(KeyW)": "Ц", + "(KeyE)": "У", + "(KeyR)": "К", + "(KeyT)": "Е", + "(KeyY)": "Н", + "(KeyU)": "Г", + "(KeyI)": "Ш", + "(KeyO)": "Щ", + "(KeyP)": "З", + "(BracketLeft)": "Х", + "(BracketRight)": "Ї", + "(KeyA)": "Ф", + "(KeyS)": "І", + "(KeyD)": "В", + "(KeyF)": "А", + "(KeyG)": "П", + "(KeyH)": "Р", + "(KeyJ)": "О", + "(KeyK)": "Л", + "(KeyL)": "Д", + "(Semicolon)": "Ж", + "(Quote)": "Є", + "(KeyZ)": "Я", + "(KeyX)": "Ч", + "(KeyC)": "С", + "(KeyV)": "М", + "(KeyB)": "И", + "(KeyN)": "Т", + "(KeyM)": "Ь", + "(Comma)": "Б", + "(Period)": "Ю", + "(IntlBackslash)": "Ґ", + "(Backquote)": "₴", + "(Digit2)": '"', + "(Digit3)": "№", + "(Digit4)": ";", + "(Digit6)": ":", + "(Digit7)": "?", + "(Backslash)": "/", + "(Slash)": ",", +}; + +export const modifierDisplayMap = en_US.modifierDisplayMap; +export const virtualKeyboard = en_US.virtualKeyboard; + +export const uk_UA: KeyboardLayout = { + isoCode, + name, + chars, + keyDisplayMap, + modifierDisplayMap, + virtualKeyboard, +};