in_sdl: remove lastKeyDown hack

was no longer needed and was causing issues typing underscores (US keyboard layout) on Linux/SDL2 where SDL_TEXTINPUT is delivered before the SDL_KEYDOWN.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1109 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
Eric Wasylishen 2014-10-13 03:21:47 +00:00
parent bd07399747
commit aeb4ed86d2

View file

@ -597,10 +597,7 @@ void IN_SendKeyEvents (void)
SDL_Event event; SDL_Event event;
int key; int key;
qboolean down; qboolean down;
#if defined(USE_SDL2)
static int lastKeyDown = 0;
#endif
while (SDL_PollEvent(&event)) while (SDL_PollEvent(&event))
{ {
switch (event.type) switch (event.type)
@ -630,7 +627,6 @@ void IN_SendKeyEvents (void)
// SDL2: We use SDL_TEXTINPUT for typing in the console / chat. // SDL2: We use SDL_TEXTINPUT for typing in the console / chat.
// SDL2 uses the local keyboard layout and handles modifiers // SDL2 uses the local keyboard layout and handles modifiers
// (shift for uppercase, etc.) for us. // (shift for uppercase, etc.) for us.
if (!Key_IgnoreTextInput(lastKeyDown))
{ {
unsigned char *ch; unsigned char *ch;
for (ch = (unsigned char *)event.text.text; *ch; ch++) for (ch = (unsigned char *)event.text.text; *ch; ch++)
@ -666,10 +662,6 @@ void IN_SendKeyEvents (void)
if (down && textmode && IN_NumpadKey(key) && IN_ExpectCharEvent(event)) if (down && textmode && IN_NumpadKey(key) && IN_ExpectCharEvent(event))
key = 0; key = 0;
#if defined(USE_SDL2)
lastKeyDown = down ? key : 0;
#endif
Key_Event (key, down); Key_Event (key, down);
#if !defined(USE_SDL2) #if !defined(USE_SDL2)