From 37372f49b3a30cc40b09e0ec68a6559e9960fe11 Mon Sep 17 00:00:00 2001 From: funto66 Date: Sun, 27 Jan 2013 09:07:23 +0000 Subject: [PATCH] Wiimote: use HOME for pause + hack to fix accelerometers reporting for some people (needs a better fix) git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@12430 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/input/wiimote_manager.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/input/wiimote_manager.cpp b/src/input/wiimote_manager.cpp index a0903b095..924fac36c 100644 --- a/src/input/wiimote_manager.cpp +++ b/src/input/wiimote_manager.cpp @@ -97,7 +97,7 @@ static void setWiimoteBindings(GamepadConfig* gamepad_config) gamepad_config->setBinding(PA_DRIFT, Input::IT_STICKBUTTON, getButtonId(WIIMOTE_BUTTON_B)); gamepad_config->setBinding(PA_RESCUE, Input::IT_STICKBUTTON, getButtonId(WIIMOTE_BUTTON_PLUS)); gamepad_config->setBinding(PA_LOOK_BACK, Input::IT_STICKBUTTON, getButtonId(WIIMOTE_BUTTON_DOWN)); - gamepad_config->setBinding(PA_PAUSE_RACE, Input::IT_STICKBUTTON, getButtonId(WIIMOTE_BUTTON_MINUS)); + gamepad_config->setBinding(PA_PAUSE_RACE, Input::IT_STICKBUTTON, getButtonId(WIIMOTE_BUTTON_HOME)); gamepad_config->setBinding(PA_MENU_UP, Input::IT_STICKBUTTON, getButtonId(WIIMOTE_BUTTON_RIGHT)); gamepad_config->setBinding(PA_MENU_DOWN, Input::IT_STICKBUTTON, getButtonId(WIIMOTE_BUTTON_LEFT)); @@ -147,11 +147,6 @@ void Wiimote::init(wiimote_t* wiimote_handle, int wiimote_id, GamepadConfig* gam WIIMOTE_BUTTONS, gamepad_config ); device_manager->addGamepad(m_gamepad_device); - - // Enable accelerometer reporting - // TODO: this should only be done when needed (i.e when racing) - // so as to avoid wasting wiimote batteries. - wiiuse_motion_sensing(m_wiimote_handle, 1); } // ----------------------------------------------------------------------------- @@ -370,6 +365,13 @@ void WiimoteManager::threadFunc() if(!m_wiimotes[i].isConnected()) continue; + // Enable accelerometer reporting + // TODO: this should only be done when needed (i.e when racing) + // so as to avoid wasting wiimote batteries. + // TODO: this should only be done once, but there have been reports that it didn't + // work for some people -> need to find a better fix + wiiuse_motion_sensing(m_wiimotes[i].getWiimoteHandle(), 1); + switch (m_all_wiimote_handles[i]->event) { case WIIUSE_EVENT: