From a740f7754cafedc488333a4a45dd8032b2603992 Mon Sep 17 00:00:00 2001 From: Edward Rudd Date: Wed, 1 Jan 2014 15:56:38 -0500 Subject: [PATCH] add option to choose whether left alt or both alts toggle's fullscreen --- src/config.cpp | 2 ++ src/config.h | 1 + src/eventthread.cpp | 3 ++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/config.cpp b/src/config.cpp index f57587b..6633f8b 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -46,6 +46,7 @@ Config::Config() frameSkip(true), solidFonts(false), gameFolder("."), + anyAltToggleFS(false), allowSymlinks(false) { } @@ -64,6 +65,7 @@ void Config::read() PO_DESC(frameSkip, bool) \ PO_DESC(solidFonts, bool) \ PO_DESC(gameFolder, std::string) \ + PO_DESC(anyAltToggleFS, bool) \ PO_DESC(allowSymlinks, bool) \ PO_DESC(customScript, std::string) diff --git a/src/config.h b/src/config.h index a01dac9..235a69a 100644 --- a/src/config.h +++ b/src/config.h @@ -44,6 +44,7 @@ struct Config bool solidFonts; std::string gameFolder; + bool anyAltToggleFS; bool allowSymlinks; std::string customScript; diff --git a/src/eventthread.cpp b/src/eventthread.cpp index 71d8d84..c0b63d8 100644 --- a/src/eventthread.cpp +++ b/src/eventthread.cpp @@ -70,6 +70,7 @@ void EventThread::process(RGSSThreadData &rtData) WindowSizeNotify &windowSizeMsg = rtData.windowSizeMsg; fullscreen = rtData.config.fullscreen; + int toggleFSMod = rtData.config.anyAltToggleFS ? KMOD_ALT : KMOD_LALT; fps.lastFrame = SDL_GetPerformanceCounter(); fps.displaying = false; @@ -145,7 +146,7 @@ void EventThread::process(RGSSThreadData &rtData) case SDL_KEYDOWN : if (event.key.keysym.scancode == SDL_SCANCODE_RETURN && - (event.key.keysym.mod & KMOD_ALT)) + (event.key.keysym.mod & toggleFSMod)) { setFullscreen(win, !fullscreen); if (!fullscreen && havePendingTitle)