The hat index passed to the application should be zero-based with no holes
authorSam Lantinga <slouken@libsdl.org>
Wed, 12 Jun 2019 10:35:47 -0700
changeset 12847baae9331abc0
parent 12846 c54ce7eddcbe
child 12848 a9a7c1e48f0b
The hat index passed to the application should be zero-based with no holes
src/joystick/linux/SDL_sysjoystick.c
     1.1 --- a/src/joystick/linux/SDL_sysjoystick.c	Wed Jun 12 10:32:36 2019 -0700
     1.2 +++ b/src/joystick/linux/SDL_sysjoystick.c	Wed Jun 12 10:35:47 2019 -0700
     1.3 @@ -773,9 +773,8 @@
     1.4      }
     1.5      if (value != the_hat->axis[axis]) {
     1.6          the_hat->axis[axis] = value;
     1.7 -        SDL_PrivateJoystickHat(stick, hat,
     1.8 -                               position_map[the_hat->
     1.9 -                                            axis[1]][the_hat->axis[0]]);
    1.10 +        SDL_PrivateJoystickHat(stick, stick->hwdata->hats_indices[hat],
    1.11 +                               position_map[the_hat->axis[1]][the_hat->axis[0]]);
    1.12      }
    1.13  }
    1.14