Show key when the key string is empty

This commit is contained in:
Florian Bruhin 2018-03-05 12:45:13 +01:00
parent 67b4502fdb
commit 3275681afd

View File

@ -231,6 +231,10 @@ class KeyInfo:
modifiers &= ~_MODIFIER_MAP[self.key]
elif is_printable(self.key):
# "normal" binding
if not key_string:
raise ValueError("Got empty string for key 0x{:x}!"
.format(self.key))
assert len(key_string) == 1, key_string
if self.modifiers == Qt.ShiftModifier:
return key_string.upper()