diff --git a/src/guiengine/abstract_state_manager.cpp b/src/guiengine/abstract_state_manager.cpp index 7eafd76a5..6c7c0d0d8 100644 --- a/src/guiengine/abstract_state_manager.cpp +++ b/src/guiengine/abstract_state_manager.cpp @@ -165,7 +165,6 @@ void AbstractStateManager::popMenu() { m_game_mode = MENU; switchToScreen(m_menu_stack[m_menu_stack.size()-1].c_str()); - input_manager->getDeviceList()->setAssignMode(NO_ASSIGN); // No assign mode on menus by default getCurrentScreen()->init(); } } diff --git a/src/input/device_manager.cpp b/src/input/device_manager.cpp index d28d5f0a2..0b855b221 100644 --- a/src/input/device_manager.cpp +++ b/src/input/device_manager.cpp @@ -10,6 +10,8 @@ #include "states_screens/state_manager.hpp" #include "io/file_manager.hpp" +#define INPUT_MODE_DEBUG 0 + DeviceManager::DeviceManager() { m_latest_used_device = NULL; @@ -89,6 +91,12 @@ void DeviceManager::setAssignMode(const PlayerAssignMode assignMode) { m_assign_mode = assignMode; +#if INPUT_MODE_DEBUG + if (assignMode == NO_ASSIGN) std::cout << "====== DeviceManager::setAssignMode(NO_ASSIGN) ======\n"; + if (assignMode == ASSIGN) std::cout << "====== DeviceManager::setAssignMode(ASSIGN) ======\n"; + if (assignMode == DETECT_NEW) std::cout << "====== DeviceManager::setAssignMode(DETECT_NEW) ======\n"; +#endif + // when going back to no-assign mode, do some cleanup if (assignMode == NO_ASSIGN) { @@ -262,7 +270,7 @@ InputDevice* DeviceManager::getLatestUsedDevice() if (m_latest_used_device == NULL) { - std::cout<< "========== No latest device, returning keyboard ==========\n"; + //std::cout<< "========== No latest device, returning keyboard ==========\n"; return m_keyboards.get(0); // FIXME: is this right? } diff --git a/src/input/input_manager.cpp b/src/input/input_manager.cpp index d7991b327..a7f0726da 100644 --- a/src/input/input_manager.cpp +++ b/src/input/input_manager.cpp @@ -49,6 +49,8 @@ using GUIEngine::EventPropagation; using GUIEngine::EVENT_LET; using GUIEngine::EVENT_BLOCK; +#define INPUT_MODE_DEBUG 0 + //----------------------------------------------------------------------------- /** Initialise input */ @@ -397,6 +399,9 @@ void InputManager::dispatchInput(Input::InputType type, int deviceID, int btnID, //----------------------------------------------------------------------------- void InputManager::setMasterPlayerOnly(bool enabled) { +#if INPUT_MODE_DEBUG + std::cout << "====== InputManager::setMasterPlayerOnly(" << enabled << ") ======\n"; +#endif m_master_player_only = enabled; } /** Returns whether only the master player should be allowed to perform changes in menus */ @@ -616,6 +621,9 @@ void InputManager::setMode(InputDriverMode new_mode) switch (new_mode) { case MENU: +#if INPUT_MODE_DEBUG + std::cout << "====== InputManager::setMode(MENU) ======\n"; +#endif switch (m_mode) { case INGAME: @@ -673,6 +681,9 @@ void InputManager::setMode(InputDriverMode new_mode) break; case INGAME: +#if INPUT_MODE_DEBUG + std::cout << "====== InputManager::setMode(INGAME) ======\n"; +#endif // We must be in menu mode now in order to switch. assert (m_mode == MENU); @@ -689,6 +700,9 @@ void InputManager::setMode(InputDriverMode new_mode) break; case INPUT_SENSE_KEYBOARD: case INPUT_SENSE_GAMEPAD: +#if INPUT_MODE_DEBUG + std::cout << "====== InputManager::setMode(INPUT_SENSE_*) ======\n"; +#endif // We must be in menu mode now in order to switch. assert (m_mode == MENU); @@ -705,6 +719,9 @@ void InputManager::setMode(InputDriverMode new_mode) break; case LOWLEVEL: +#if INPUT_MODE_DEBUG + std::cout << "====== InputManager::setMode(LOWLEVEL) ======\n"; +#endif // We must be in menu mode now in order to switch. assert (m_mode == MENU);