Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mdevaev committed Sep 23, 2020
1 parent 3f74311 commit f605e91
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 20 deletions.
13 changes: 7 additions & 6 deletions genmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion keymap.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 0 additions & 2 deletions kvmd/keyboard/mappings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 6 additions & 7 deletions web/kvm/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand Down
7 changes: 3 additions & 4 deletions web/kvm/window-keyboard.pug
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit f605e91

Please sign in to comment.