add in alt+enter keyboard shortcut to test common to toggle fullscreen desktop
authorEdward Rudd <urkle@outoforder.cc>
Tue, 04 Jun 2013 12:02:18 -0400
changeset 7340 72134ccb9502
parent 7339 2d2fd56db9b7
child 7341 675c85d46f30
add in alt+enter keyboard shortcut to test common to toggle fullscreen desktop
src/test/SDL_test_common.c
--- a/src/test/SDL_test_common.c	Sat Jun 29 14:40:55 2013 -0700
+++ b/src/test/SDL_test_common.c	Tue Jun 04 12:02:18 2013 -0400
@@ -1307,6 +1307,17 @@
                         SDL_SetWindowFullscreen(window, SDL_TRUE);
                     }
                 }
+            } else if (event->key.keysym.mod & KMOD_ALT) {
+                /* Ctrl-Enter toggle fullscreen desktop */
+                SDL_Window *window = SDL_GetWindowFromID(event->key.windowID);
+                if (window) {
+                    Uint32 flags = SDL_GetWindowFlags(window);
+                    if (flags & SDL_WINDOW_FULLSCREEN) {
+                        SDL_SetWindowFullscreen(window, SDL_FALSE);
+                    } else {
+                        SDL_SetWindowFullscreen(window, SDL_WINDOW_FULLSCREEN_DESKTOP);
+                    }
+                }
             }
             break;
         case SDLK_b: