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.
This commit is contained in:
Yamagi Burmeister 2015-01-28 20:41:02 +01:00
parent 403d26d520
commit 08f78ec3b5
2 changed files with 1 additions and 1 deletions

View file

@ -595,7 +595,6 @@ IN_Init(void)
in_relativemode = (SDL_GetRelativeMouseMode() == SDL_TRUE); in_relativemode = (SDL_GetRelativeMouseMode() == SDL_TRUE);
SDL_StartTextInput(); SDL_StartTextInput();
#else #else
SDL_EnableUNICODE(SDL_TRUE);
SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL); SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
#endif #endif

View file

@ -344,6 +344,7 @@ static qboolean CreateSDLWindow(int flags)
return true; return true;
#else #else
window = SDL_SetVideoMode(vid.width, vid.height, 0, flags); window = SDL_SetVideoMode(vid.width, vid.height, 0, flags);
SDL_EnableUNICODE(SDL_TRUE);
return window != NULL; return window != NULL;
#endif #endif
} }