From 7ec971309a2cb121fee597344ffe44140102695c Mon Sep 17 00:00:00 2001 From: hikerstk Date: Sun, 28 Nov 2010 11:39:09 +0000 Subject: [PATCH] Fixed continuous warnings message "Ignoring '...', you needed to join earlier to play!" This is caused by polling the joystick device, and the joystick events triggering the message. For now the message is not printed if the joystick value is inside the deadzone value for the joystick (this means that the deadzone is tested at two locations - once in input manager to avoid the message, once in input_device - but the latter is not triggered in this case since player is NULL). Not ideal, so a better solution would be welcome. git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@6740 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/input/input_manager.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/input/input_manager.cpp b/src/input/input_manager.cpp index 535a55c31..17a7ab523 100644 --- a/src/input/input_manager.cpp +++ b/src/input/input_manager.cpp @@ -485,7 +485,8 @@ void InputManager::dispatchInput(Input::InputType type, int deviceID, int button { GamePadDevice* gp = getDeviceList()->getGamePadFromIrrID(deviceID); - if (gp != NULL) + if (gp != NULL && + abs(value)>gp->m_deadzone) { //I18N: message shown when an input device is used but is not associated to any player GUIEngine::showMessage(StringUtils::insertValues(_("Ignoring '%s', you needed to join earlier to play!"), @@ -575,11 +576,7 @@ EventPropagation InputManager::input(const SEvent& event) event.JoystickEvent.Joystick, axis_id, value); } - // FIXME - AD_NEGATIVE/AD_POSITIVE are probably useless since value contains that info too -// if (value < 0) dispatchInput(Input::IT_STICKMOTION, event.JoystickEvent.Joystick, axis_id, Input::AD_NEUTRAL, value); -// else -// dispatchInput(Input::IT_STICKMOTION, event.JoystickEvent.Joystick, axis_id, Input::AD_POSITIVE, value); } GamePadDevice* gp = getDeviceList()->getGamePadFromIrrID(event.JoystickEvent.Joystick);