From 1196285045aeb5748c531972ec0da04066f394a2 Mon Sep 17 00:00:00 2001 From: Devaev Maxim Date: Thu, 6 Aug 2020 07:03:29 +0300 Subject: ps2 --- genmap.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'genmap.py') diff --git a/genmap.py b/genmap.py index 3efee125..c414fc6e 100755 --- a/genmap.py +++ b/genmap.py @@ -61,7 +61,7 @@ class _X11Key: class _KeyMapping: web_name: str serial_code: int - arduino_name: str + usb_name: str otg_key: _OtgKey ps2_key: _Ps2Key at1_code: int @@ -99,15 +99,10 @@ def _parse_otg_key(key: str) -> _OtgKey: def _parse_ps2_key(key: str) -> _Ps2Key: - (raw_type, raw_code) = key.split(":") + (code_type, raw_code) = key.split(":") return _Ps2Key( code=int(raw_code, 16), - type={ - "reg": 0, - "spec": 1, - "pause": 2, - "print": 3, - }[raw_type], + type=code_type, ) @@ -119,7 +114,7 @@ def _read_keymap_csv(path: str) -> List[_KeyMapping]: keymap.append(_KeyMapping( web_name=row["web_name"], serial_code=int(row["serial_code"]), - arduino_name=row["arduino_name"], + usb_name=row["usb_name"], otg_key=_parse_otg_key(row["otg_key"]), ps2_key=_parse_ps2_key(row["ps2_key"]), at1_code=int(row["at1_code"], 16), -- cgit v1.2.3