From a5a8b3ec8767cab8a3647acc64d19d4801d14ee1 Mon Sep 17 00:00:00 2001 From: auria Date: Mon, 3 May 2010 17:18:47 +0000 Subject: [PATCH] Improved behavior when escape is pressed in a device config screen git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@5362 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/states_screens/options_screen_input2.cpp | 9 +++++++++ src/states_screens/options_screen_input2.hpp | 3 +++ 2 files changed, 12 insertions(+) diff --git a/src/states_screens/options_screen_input2.cpp b/src/states_screens/options_screen_input2.cpp index d03d08bd3..5a07f330b 100644 --- a/src/states_screens/options_screen_input2.cpp +++ b/src/states_screens/options_screen_input2.cpp @@ -417,3 +417,12 @@ void OptionsScreenInput2::unloaded() { } +// ----------------------------------------------------------------------------- + +bool OptionsScreenInput2::onEscapePressed() +{ + StateManager::get()->replaceTopMostScreen(OptionsScreenInput::getInstance()); + return false; // don't use standard escape key handler, we handled it differently +} + +// ----------------------------------------------------------------------------- diff --git a/src/states_screens/options_screen_input2.hpp b/src/states_screens/options_screen_input2.hpp index fc6bbb394..09588a8ef 100644 --- a/src/states_screens/options_screen_input2.hpp +++ b/src/states_screens/options_screen_input2.hpp @@ -63,6 +63,9 @@ public: /** \brief implement callback from parent class GUIEngine::Screen */ virtual void tearDown(); + /** \brief implement optional callback from parent class GUIEngine::Screen */ + virtual bool onEscapePressed(); + /** * \brief invoke in "input sensing" mode, when input was sensed. * Updates the input bindings accordingly with the sensed input.