summaryrefslogtreecommitdiff
path: root/genmap.py
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 /genmap.py
parent3f743114857b11656957767bec4bfa27f4dd7fee (diff)
fixed #10
Diffstat (limited to 'genmap.py')
-rwxr-xr-xgenmap.py13
1 files changed, 7 insertions, 6 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