Add gamepad button info to --gamepad-debug, from our current bug reports this looks like info we need

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@7173 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2010-12-28 00:34:26 +00:00
parent aac61a1b30
commit fb8c9edf5e

View File

@ -609,10 +609,15 @@ EventPropagation InputManager::input(const SEvent& event)
for(int i=0; i<gp->m_button_count; i++)
{
const bool isButtonPressed = event.JoystickEvent.IsButtonPressed(i);
// Only report button events when the state of the button changes
if ((!gp->isButtonPressed(i) && isButtonPressed) || (gp->isButtonPressed(i) && !isButtonPressed))
{
if (UserConfigParams::m_gamepad_debug)
{
printf("button %i, status=%i\n", i, isButtonPressed);
}
dispatchInput(Input::IT_STICKBUTTON, event.JoystickEvent.Joystick, i, Input::AD_POSITIVE,
isButtonPressed ? Input::MAX_VALUE : 0);
}