From 8325463c7163445da6208e39e35dc2d3400610d7 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Mon, 18 Apr 2011 22:09:55 +0000 Subject: [PATCH] - ALT-F4 auto quits the game in win32 --- source/shared_lib/sources/platform/sdl/window.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/shared_lib/sources/platform/sdl/window.cpp b/source/shared_lib/sources/platform/sdl/window.cpp index d21b3002..882e266c 100644 --- a/source/shared_lib/sources/platform/sdl/window.cpp +++ b/source/shared_lib/sources/platform/sdl/window.cpp @@ -181,6 +181,14 @@ bool Window::handleEvent() { if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s %d] SDLK_RETURN pressed.\n",__FILE__,__FUNCTION__,__LINE__); toggleFullscreen(); } +#ifdef WIN32 + /* handle ALT+f4 */ + if((keyName == "f4" || keyName == "F4") + && (event.key.keysym.mod & (KMOD_LALT | KMOD_RALT))) { + if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s %d] ALT-F4 pressed.\n",__FILE__,__FUNCTION__,__LINE__); + return false; + } +#endif if(global_window) { char key = getKey(event.key.keysym,true); key = tolower(key);