From f605e91bf254dee021bbd18fe40cf9270d735950 Mon Sep 17 00:00:00 2001 From: Devaev Maxim Date: Wed, 23 Sep 2020 21:23:10 +0300 Subject: [PATCH] fixed #10 --- genmap.py | 13 +++++++------ keymap.csv | 2 +- kvmd/keyboard/mappings.py | 2 -- web/kvm/index.html | 13 ++++++------- web/kvm/window-keyboard.pug | 7 +++---- 5 files changed, 17 insertions(+), 20 deletions(-) diff --git a/genmap.py b/genmap.py index c0e5572f..416934ef 100755 --- a/genmap.py +++ b/genmap.py @@ -84,11 +84,12 @@ def _resolve_keysym(name: str) -> int: def _parse_x11_names(names: str) -> Set[_X11Key]: keys: Set[_X11Key] = set() - for name in names.split(","): - shift = name.startswith("^") - name = (name[1:] if shift else name) - code = _resolve_keysym(name) - keys.add(_X11Key(name, code, shift)) + if names: + for name in names.split(","): + shift = name.startswith("^") + name = (name[1:] if shift else name) + code = _resolve_keysym(name) + keys.add(_X11Key(name, code, shift)) return keys @@ -118,7 +119,7 @@ def _read_keymap_csv(path: str) -> List[_KeyMapping]: otg_key=_parse_otg_key(row["otg_key"]), ps2_key=_parse_ps2_key(row["ps2_key"]), at1_code=int(row["at1_code"], 16), - x11_keys=_parse_x11_names(row["x11_names"]), + x11_keys=_parse_x11_names(row["x11_names"] or ""), )) return keymap diff --git a/keymap.csv b/keymap.csv index 8f30f851..bff3b520 100644 --- a/keymap.csv +++ b/keymap.csv @@ -104,4 +104,4 @@ Numpad9,102,KEYPAD_9,0x61,reg:0x7d,0x49,XK_KP_9 Numpad0,103,KEYPAD_0,0x62,reg:0x70,0x52,XK_KP_0 NumpadDecimal,104,KEYPAD_DOT,0x63,reg:0x71,0x53,XK_KP_Decimal Power,105,KEY_POWER,0x66,spec:0x5e,0xe05e,XK_XF86_Sleep -IntlBackslash,106,KEY_NON_US,0x64,reg:0x61,0x56,"^XK_greater,XK_less" +IntlBackslash,106,KEY_NON_US,0x64,reg:0x61,0x56 diff --git a/kvmd/keyboard/mappings.py b/kvmd/keyboard/mappings.py index 0c4e805d..5ee53c19 100644 --- a/kvmd/keyboard/mappings.py +++ b/kvmd/keyboard/mappings.py @@ -294,8 +294,6 @@ class At1Key: 65456: At1Key(code=82, shift=False), # XK_KP_0 65454: At1Key(code=83, shift=False), # XK_KP_Decimal 65301: At1Key(code=84, shift=False), # XK_Sys_Req - 60: At1Key(code=86, shift=False), # XK_less - 62: At1Key(code=86, shift=True), # XK_greater 65480: At1Key(code=87, shift=False), # XK_F11 65481: At1Key(code=88, shift=False), # XK_F12 65421: At1Key(code=57372, shift=False), # XK_KP_Enter diff --git a/web/kvm/index.html b/web/kvm/index.html index 39e1cfb8..0da86456 100644 --- a/web/kvm/index.html +++ b/web/kvm/index.html @@ -681,14 +681,10 @@
-
+

Shift
-
-
-
-
Z
@@ -729,7 +725,7 @@
?
/
-
+

Shift
@@ -837,7 +833,10 @@
-
+
+
N/US +
+
PWR
diff --git a/web/kvm/window-keyboard.pug b/web/kvm/window-keyboard.pug index 87abf64e..1354726c 100644 --- a/web/kvm/window-keyboard.pug +++ b/web/kvm/window-keyboard.pug @@ -51,14 +51,13 @@ mixin lamp(cls) +key("Quote") "#[br]' +key("Enter", "wide-3 right small") Enter#[br]↵ div(class="keypad-row") - +modifier("ShiftLeft", "wide-3 left small") Shift - +key("IntlBackslash", "small") + +modifier("ShiftLeft", "wide-4 left small") Shift each key in ["Z", "X", "C", "V", "B", "N", "M"] +key(`Key${key}`, "single") #{key} +key("Comma") <#[br], +key("Period") >#[br]. +key("Slash") ?#[br]/ - +modifier("ShiftRight", "wide-3 right small") Shift + +modifier("ShiftRight", "wide-4 right small") Shift div(class="keypad-row") +modifier("ControlLeft", "wide-1 left small") Ctrl +modifier("MetaLeft", "wide-1 left small") Win @@ -96,7 +95,7 @@ mixin lamp(cls) div(class="keypad-row") +empty_key() +empty_key() - +empty_key() + +key("IntlBackslash", "small") N/US +key("Power", "small") PWR hr div(class="keypad-row")