Skip to content

Commit

Permalink
Ignore printable keycodes without unicode.
Browse files Browse the repository at this point in the history
This should fix a race condition where that could cause unprefixed
key commands (like 'v' or 'a') to trigger if KEYDOWN is present
but the TEXTINPUT hasn't been delivered yet.
  • Loading branch information
renpytom committed Sep 10, 2019
1 parent d28ecb3 commit a0dad58
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion renpy/display/behavior.py
Expand Up @@ -1386,7 +1386,10 @@ def event(self, ev, x, y, st):
if ev.unicode and ord(ev.unicode[0]) >= 32:
raw_text = ev.unicode
elif renpy.display.interface.text_event_in_queue():
raw_text = ''
raise renpy.display.core.IgnoreEvent()
elif (32 <= ev.key < 127) and not (ev.mod & (pygame.KMOD_ALT | pygame.KMOD_META)):
# Ignore printable keycodes without unicode.
raise renpy.display.core.IgnoreEvent()

if raw_text is not None:

Expand Down

0 comments on commit a0dad58

Please sign in to comment.