From 0f148eb6517f77445cbca47501e21489423aeeeb Mon Sep 17 00:00:00 2001 From: Jimb Esser Date: Sat, 16 Mar 2019 18:12:26 -0700 Subject: [PATCH] Fix polling left trigger reporting right trigger's values. --- src/joystick/SDL_gamecontroller.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/joystick/SDL_gamecontroller.c b/src/joystick/SDL_gamecontroller.c index 15af7ab9b..d417a44ba 100644 --- a/src/joystick/SDL_gamecontroller.c +++ b/src/joystick/SDL_gamecontroller.c @@ -1658,6 +1658,8 @@ SDL_GameControllerGetAxis(SDL_GameController * gamecontroller, SDL_GameControlle float normalized_value = (float)(value - binding->input.axis.axis_min) / (binding->input.axis.axis_max - binding->input.axis.axis_min); value = binding->output.axis.axis_min + (int)(normalized_value * (binding->output.axis.axis_max - binding->output.axis.axis_min)); } + } else { + value = 0; } } else if (binding->inputType == SDL_CONTROLLER_BINDTYPE_BUTTON) { value = SDL_JoystickGetButton(gamecontroller->joystick, binding->input.button);