diff --git a/stepmania/src/CodeDetector.cpp b/stepmania/src/CodeDetector.cpp index 3031cbc529..675a9a6ca7 100644 --- a/stepmania/src/CodeDetector.cpp +++ b/stepmania/src/CodeDetector.cpp @@ -64,6 +64,7 @@ const CString g_sCodeNames[CodeDetector::NUM_CODES] = { "NextBannerGroup2", "SaveScreenshot", "CancelAllPlayerOptions", + "BackInEventMode", }; CodeItem g_CodeItems[CodeDetector::NUM_CODES]; diff --git a/stepmania/src/CodeDetector.h b/stepmania/src/CodeDetector.h index e5e73be36d..2ee8f84736 100644 --- a/stepmania/src/CodeDetector.h +++ b/stepmania/src/CodeDetector.h @@ -76,6 +76,7 @@ public: CODE_BW_NEXT_GROUP2, CODE_SAVE_SCREENSHOT, CODE_CANCEL_ALL_PLAYER_OPTIONS, + CODE_BACK_IN_EVENT_MODE, NUM_CODES // leave this at the end }; diff --git a/stepmania/src/ScreenManager.cpp b/stepmania/src/ScreenManager.cpp index 6f17264a82..033b4bb00a 100644 --- a/stepmania/src/ScreenManager.cpp +++ b/stepmania/src/ScreenManager.cpp @@ -50,6 +50,7 @@ #include "ProfileManager.h" #include "ThemeManager.h" #include "MemoryCardManager.h" +#include "CodeDetector.h" ScreenManager* SCREENMAN = NULL; // global and accessable from anywhere in our program @@ -483,6 +484,14 @@ void ScreenManager::Input( const DeviceInput& DeviceI, const InputEventType type // LOG->Trace( "ScreenManager::Input( %d-%d, %d-%d, %d-%d, %d-%d )", // DeviceI.device, DeviceI.button, GameI.controller, GameI.button, MenuI.player, MenuI.button, StyleI.player, StyleI.col ); + // check back in event mode + if( CodeDetector::EnteredCode(GameI.controller,CodeDetector::CODE_BACK_IN_EVENT_MODE) ) + { + MenuInput mi(MenuI.player,MENU_BUTTON_BACK); + m_ScreenStack.back()->Input( DeviceI, type, GameI, mi, StyleI ); + return; + } + // pass input only to topmost state if( !m_ScreenStack.empty() ) m_ScreenStack.back()->Input( DeviceI, type, GameI, MenuI, StyleI );