Skip to content

Commit

Permalink
Fix polling left trigger reporting right trigger's values.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jimbly committed Mar 17, 2019
1 parent 58ca76b commit 0f148eb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/joystick/SDL_gamecontroller.c
Expand Up @@ -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);
Expand Down

0 comments on commit 0f148eb

Please sign in to comment.