From cd1561ac57a5360bb791937ec0e2307bdcdaea2c Mon Sep 17 00:00:00 2001 From: dhewg Date: Thu, 29 Dec 2011 20:53:54 +0100 Subject: [PATCH] Implement alt+tab for toggling fullscreen mode --- neo/sys/events.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/neo/sys/events.cpp b/neo/sys/events.cpp index 8d9eaa02..902807fd 100644 --- a/neo/sys/events.cpp +++ b/neo/sys/events.cpp @@ -33,6 +33,7 @@ If you have questions concerning this license or the applicable additional terms #include "idlib/Heap.h" #include "framework/Common.h" #include "framework/KeyInput.h" +#include "renderer/RenderSystem.h" #include "sys/sys_public.h" @@ -392,6 +393,13 @@ sysEvent_t Sys_GetEvent() { return res_none; case SDL_KEYDOWN: + if (ev.key.keysym.sym == SDLK_RETURN && (ev.key.keysym.mod & KMOD_LALT) > 0) { + cvarSystem->SetCVarBool("r_fullscreen", !renderSystem->IsFullScreen()); + PushConsoleEvent("vid_restart"); + return res_none; + } + + // fall through case SDL_KEYUP: key = mapkey(ev.key.keysym.sym);