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
This commit is contained in:
funto66 2013-01-27 09:07:23 +00:00
parent edee6befad
commit 37372f49b3

View File

@ -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: