This fixes another regression of commit
5a53ae0c,
888ee049 and
35da46e4 that still causes incorrect key/text event handling.
The problem occurs when entering uppercase letters, which creates two
key events (pressed and released) with the lowercase letter (while
modifier state indicates that the Shift key is active), plus one text
event with the uppercase letter. The previous logic caused both cases
to be handled as a new key event, effectively handling that letter
twice (one time in lowercase, and another time in uppercase).
An additional check for text input style modifier keys prevents the
lowercase variant of the case described above not to be handled.
if (game_status == GAME_MODE_PLAYING)
return FALSE;
+ // if Shift or right Alt key is pressed, handle key as text input
+ if ((GetKeyModState() & KMOD_TextInput) != KMOD_None)
+ return TRUE;
+
// ignore raw keys as text input when not in text input mode
if (KSYM_RAW(key) && !textinput_status)
return FALSE;
KMOD_Meta | \
KMOD_Alt)
+#define KMOD_TextInput (KMOD_Shift | KMOD_Alt_R)
+
+
// SDL function definitions
const char *SDLGetRendererName(void);