diff options
author | Devaev Maxim <[email protected]> | 2020-09-23 21:23:10 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2020-09-23 22:58:45 +0300 |
commit | f605e91bf254dee021bbd18fe40cf9270d735950 (patch) | |
tree | 8c11cd075aba9e1c60ce78814f8f2fb1ded71d88 /genmap.py | |
parent | 3f743114857b11656957767bec4bfa27f4dd7fee (diff) |
fixed #10
Diffstat (limited to 'genmap.py')
-rwxr-xr-x | genmap.py | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -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 |