Added SDL_JoystickGetAxisInitialState() to get a joystick axis' initial value.

This is useful for controller mapping programs to determine an axis' zero state
This commit is contained in:
Sam Lantinga 2017-01-04 10:28:07 -08:00
parent c52ae60869
commit 724ff3b29e
6 changed files with 45 additions and 3 deletions

View file

@ -244,6 +244,18 @@ extern DECLSPEC int SDLCALL SDL_JoystickEventState(int state);
extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick * joystick,
int axis);
/**
* Get the initial state of an axis control on a joystick.
*
* The state is a value ranging from -32768 to 32767.
*
* The axis indices start at index 0.
*
* \return SDL_TRUE if this axis has any initial value, or SDL_FALSE if not.
*/
extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAxisInitialState(SDL_Joystick * joystick,
int axis, Sint16 *state);
/**
* \name Hat positions
*/