Skip to content

Commit 39432cb

Browse files
committed
fix KeyboardLayout not pressing altgr and shift together
1 parent 4cc7b8c commit 39432cb

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

libraries/keyboard_layout.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,15 @@ def keycodes(self, char):
8282
keycodes('é')
8383
"""
8484
keycode = self._char_to_keycode(char)
85-
if keycode & self.SHIFT_FLAG:
86-
return (self.SHIFT_CODE, keycode & ~self.SHIFT_FLAG)
85+
codes = []
8786
if char in self.NEED_ALTGR:
88-
return (self.RIGHT_ALT_CODE, keycode)
87+
codes.append(self.RIGHT_ALT_CODE)
88+
if keycode & self.SHIFT_FLAG:
89+
codes.extend((self.SHIFT_CODE, keycode & ~self.SHIFT_FLAG))
90+
else:
91+
codes.append(keycode)
8992

90-
return (keycode,)
93+
return codes
9194

9295
def _above128charval_to_keycode(self, char_val):
9396
"""Return keycode for above 128 ascii codes.

0 commit comments

Comments
 (0)