From 08f78ec3b551e71ee4c2fef7a91e44670f8bb71c Mon Sep 17 00:00:00 2001 From: Yamagi Burmeister Date: Wed, 28 Jan 2015 20:41:02 +0100 Subject: [PATCH] Set SDL_EnableUNICODE() right after the window is created This works around a bug in SDL 1.2 were the SDL_EnableUNICODE() state is reset to false after the window is reacreated. Setting it in the render backend ensures that no keystrokes are lost. This fixes #56. --- src/backends/sdl/input.c | 1 - src/backends/sdl/refresh.c | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backends/sdl/input.c b/src/backends/sdl/input.c index 0dbbd061..0887900f 100644 --- a/src/backends/sdl/input.c +++ b/src/backends/sdl/input.c @@ -595,7 +595,6 @@ IN_Init(void) in_relativemode = (SDL_GetRelativeMouseMode() == SDL_TRUE); SDL_StartTextInput(); #else - SDL_EnableUNICODE(SDL_TRUE); SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL); #endif diff --git a/src/backends/sdl/refresh.c b/src/backends/sdl/refresh.c index b435dd68..395bad16 100644 --- a/src/backends/sdl/refresh.c +++ b/src/backends/sdl/refresh.c @@ -344,6 +344,7 @@ static qboolean CreateSDLWindow(int flags) return true; #else window = SDL_SetVideoMode(vid.width, vid.height, 0, flags); + SDL_EnableUNICODE(SDL_TRUE); return window != NULL; #endif }