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 99e10ef506
commit 4938c5054e
6 changed files with 45 additions and 3 deletions

View file

@ -31,7 +31,8 @@
/* The SDL joystick structure */
typedef struct _SDL_JoystickAxisInfo
{
Sint16 value; /* Current axis states */
Sint16 initial_value; /* Initial axis state */
Sint16 value; /* Current axis state */
Sint16 zero; /* Zero point on the axis (-32768 for triggers) */
SDL_bool has_initial_value; /* Whether we've seen a value on the axis yet */
SDL_bool sent_initial_value; /* Whether we've sent the initial axis value */