summaryrefslogtreecommitdiff
path: root/genmap.py
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2020-07-16 21:58:06 +0300
committerDevaev Maxim <[email protected]>2020-07-16 21:58:06 +0300
commit2f640b7a08a9de8707f18e12452763125e354105 (patch)
treea59f5432ea0a7bcf16e91db43cf93fb7174019a4 /genmap.py
parent5613a7b2b5774a3d2b9773dd68880140f8e89d31 (diff)
added power key to hids
Diffstat (limited to 'genmap.py')
-rwxr-xr-xgenmap.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/genmap.py b/genmap.py
index 8457393b..b8b20213 100755
--- a/genmap.py
+++ b/genmap.py
@@ -28,9 +28,11 @@ import dataclasses
from typing import Set
from typing import List
+from typing import Optional
import Xlib.keysymdef.latin1
import Xlib.keysymdef.miscellany
+import Xlib.keysymdef.xf86
import mako.template
@@ -60,9 +62,15 @@ class _KeyMapping:
def _resolve_keysym(name: str) -> int:
- code = getattr(Xlib.keysymdef.latin1, name, None)
- if code is None:
- code = getattr(Xlib.keysymdef.miscellany, name, None)
+ code: Optional[int] = None
+ for module in [
+ Xlib.keysymdef.latin1,
+ Xlib.keysymdef.miscellany,
+ Xlib.keysymdef.xf86,
+ ]:
+ code = getattr(module, name, None)
+ if code is not None:
+ break
assert code is not None, name
return code