Fix polling left trigger reporting right trigger's values.

This commit is contained in:
Jimb Esser 2019-03-16 18:12:26 -07:00
parent 58ca76bee3
commit 0f148eb651
1 changed files with 2 additions and 0 deletions

View File

@ -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);