From a7f215396a9278d148d3b4bffdc8e754ab5cc30c Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 22 Jul 2012 19:35:29 +0300 Subject: Add key for disable full screen mode. Minus on numeric keyboard. --- src/actionmanager.cpp | 9 +++++++++ src/actionmanager.h | 1 + src/gui/setupactiondata.h | 5 +++++ src/keyboarddata.h | 7 +++++++ src/keydata.h | 1 + 5 files changed, 23 insertions(+) diff --git a/src/actionmanager.cpp b/src/actionmanager.cpp index fa3c03526..28e5b9fc3 100644 --- a/src/actionmanager.cpp +++ b/src/actionmanager.cpp @@ -23,6 +23,7 @@ #include "dropshortcut.h" #include "emoteshortcut.h" #include "game.h" +#include "graphics.h" #include "inputevent.h" #include "itemshortcut.h" #include "inputmanager.h" @@ -1029,4 +1030,12 @@ impHandler0(targetNPC) return setTarget(ActorSprite::NPC); } +impHandler0(safeVideoMode) +{ + if (mainGraphics) + mainGraphics->setFullscreen(false); + + return true; +} + } diff --git a/src/actionmanager.h b/src/actionmanager.h index a453869d7..e415928bb 100644 --- a/src/actionmanager.h +++ b/src/actionmanager.h @@ -94,6 +94,7 @@ namespace ActionManager decHandler(targetPlayer); decHandler(targetMonster); decHandler(targetNPC); + decHandler(safeVideoMode); decHandler(hideWindows); decHandler(helpWindowShow); diff --git a/src/gui/setupactiondata.h b/src/gui/setupactiondata.h index 3be3fb39f..9c516c83f 100644 --- a/src/gui/setupactiondata.h +++ b/src/gui/setupactiondata.h @@ -159,6 +159,11 @@ static SetupActionData setupActionData0[] = Input::KEY_QUIT, "", }, + { + N_("Return to safe video mode"), + Input::KEY_SAFE_VIDEO, + "", + }, { "", Input::KEY_NO_VALUE, diff --git a/src/keyboarddata.h b/src/keyboarddata.h index dc261a402..6e0111ba9 100644 --- a/src/keyboarddata.h +++ b/src/keyboarddata.h @@ -1910,6 +1910,13 @@ static KeyData const keyData[Input::KEY_TOTAL] = { Input::GRP_GUICHAN, nullptr, Input::KEY_NO_VALUE, 50, + COND_DEFAULT}, + {"keySafeVideo", + INPUT_KEYBOARD, SDLK_KP_MINUS, + INPUT_UNKNOWN, Input::KEY_NO_VALUE, + Input::GRP_DEFAULT, + &ActionManager::safeVideoMode, + Input::KEY_NO_VALUE, 50, COND_DEFAULT} }; diff --git a/src/keydata.h b/src/keydata.h index 352f61f6a..d0c99091a 100644 --- a/src/keydata.h +++ b/src/keydata.h @@ -335,6 +335,7 @@ namespace Input KEY_GUI_PAGE_DOWN, KEY_GUI_INSERT, KEY_GUI_MOD, + KEY_SAFE_VIDEO, KEY_TOTAL }; } -- cgit v1.2.3-70-g09d2