aboutsummaryrefslogtreecommitdiffstats
path: root/src/util/genkeymap.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/genkeymap.py')
-rwxr-xr-xsrc/util/genkeymap.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/util/genkeymap.py b/src/util/genkeymap.py
index 9fd987477..b70ce5f72 100755
--- a/src/util/genkeymap.py
+++ b/src/util/genkeymap.py
@@ -365,9 +365,11 @@ class Keymap:
"""AltGr remapping table"""
# Construct raw mapping from source ASCII to target ASCII
raw = {
- source:
- self.target.get((key.modifiers | KeyModifiers.ALTGR),
- self.target[key.modifiers])[key.keycode].ascii
+ source: next((self.target[x][key.keycode].ascii
+ for x in (key.modifiers | KeyModifiers.ALTGR,
+ KeyModifiers.ALTGR, key.modifiers)
+ if x in self.target
+ and self.target[x][key.keycode].ascii), None)
for source, key in self.source.inverse.items()
}
# Identify printable keys that are unreachable via the basic map