diff options
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 |