From: Ryan C. Gordon Date: Thu, 18 Feb 2010 15:08:36 +0000 (-0500) Subject: Drop keyboard input if it was part of the grab or window/fullscreen toggle. X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=055013bac06c70d04b46bc2e66bde847bdada1d4;p=lugaru.git Drop keyboard input if it was part of the grab or window/fullscreen toggle. --- diff --git a/Source/OpenGL_Windows.cpp b/Source/OpenGL_Windows.cpp index 64fce39..a37cdda 100644 --- a/Source/OpenGL_Windows.cpp +++ b/Source/OpenGL_Windows.cpp @@ -470,6 +470,7 @@ static inline int clamp_sdl_mouse_button(Uint8 button) static void sdlEventProc(const SDL_Event &e, Game &game) { int val; + bool skipkey = false; SDLMod mod; switch(e.type) @@ -508,6 +509,7 @@ static void sdlEventProc(const SDL_Event &e, Game &game) { if (e.key.keysym.mod & KMOD_CTRL) { + skipkey = true; SDL_GrabMode mode = SDL_GRAB_ON; if ((SDL_GetVideoSurface()->flags & SDL_FULLSCREEN) == 0) { @@ -521,10 +523,13 @@ static void sdlEventProc(const SDL_Event &e, Game &game) else if (e.key.keysym.sym == SDLK_RETURN) { if (e.key.keysym.mod & KMOD_ALT) + { + skipkey = true; SDL_WM_ToggleFullScreen(SDL_GetVideoSurface()); + } } - if (e.key.keysym.sym < SDLK_LAST) + if ((!skipkey) && (e.key.keysym.sym < SDLK_LAST)) { if (KeyTable[e.key.keysym.sym] != 0xffff) SetKey(KeyTable[e.key.keysym.sym]);