summaryrefslogtreecommitdiff
path: root/genmap.py
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2020-08-06 07:03:29 +0300
committerDevaev Maxim <[email protected]>2020-08-06 07:03:29 +0300
commit1196285045aeb5748c531972ec0da04066f394a2 (patch)
tree1269a4983a6b28ef68bd32e06235ce249b266f53 /genmap.py
parent05984cee5dd698d21d2c4d717cc0fd9ce6dd92e7 (diff)
ps2
Diffstat (limited to 'genmap.py')
-rwxr-xr-xgenmap.py13
1 files changed, 4 insertions, 9 deletions
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),