]> git.jsancho.org Git - lugaru.git/blobdiff - Source/OpenGL_Windows.cpp
Drop keyboard input if it was part of the grab or window/fullscreen toggle.
[lugaru.git] / Source / OpenGL_Windows.cpp
index 64fce3903fed9ceee1857e4b16b62a8fb405bf13..a37cdda07b671cc376182fc44b44374f951f3e86 100644 (file)
@@ -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]);