summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2020-09-23 21:23:10 +0300
committerDevaev Maxim <[email protected]>2020-09-23 22:58:45 +0300
commitf605e91bf254dee021bbd18fe40cf9270d735950 (patch)
tree8c11cd075aba9e1c60ce78814f8f2fb1ded71d88
parent3f743114857b11656957767bec4bfa27f4dd7fee (diff)
fixed #10
-rwxr-xr-xgenmap.py13
-rw-r--r--keymap.csv2
-rw-r--r--kvmd/keyboard/mappings.py2
-rw-r--r--web/kvm/index.html13
-rw-r--r--web/kvm/window-keyboard.pug7
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 @@ X11_TO_AT1 = {
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 @@
</div>
</div>
<div class="keypad-row">
- <div class="modifier wide-3 left small" data-code="ShiftLeft">
+ <div class="modifier wide-4 left small" data-code="ShiftLeft">
<div class="label"><b>&bull;</b><br>Shift
</div>
</div>
- <div class="key small" data-code="IntlBackslash">
- <div class="label">
- </div>
- </div>
<div class="key single" data-code="KeyZ">
<div class="label">Z
</div>
@@ -729,7 +725,7 @@
<div class="label">?<br>/
</div>
</div>
- <div class="modifier wide-3 right small" data-code="ShiftRight">
+ <div class="modifier wide-4 right small" data-code="ShiftRight">
<div class="label"><b>&bull;</b><br>Shift
</div>
</div>
@@ -837,7 +833,10 @@
<div class="keypad-row">
<div class="empty-key"></div>
<div class="empty-key"></div>
- <div class="empty-key"></div>
+ <div class="key small" data-code="IntlBackslash">
+ <div class="label">N/US
+ </div>
+ </div>
<div class="key small" data-code="Power">
<div class="label">PWR
</div>
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]&crarr;
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") &lt;#[br],
+key("Period") &gt;#[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")