Navigation Menu

Skip to content

Commit

Permalink
Correct joystick hat indexes on linux
Browse files Browse the repository at this point in the history
The index and indices were swapped; Which is fine as long as there are
no gaps in the ABS_HAT* event availability but otherwise things do get confused.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
  • Loading branch information
sjoerdsimons committed Feb 4, 2020
1 parent d19006c commit 976eee7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/joystick/linux/SDL_sysjoystick.c
Expand Up @@ -727,7 +727,7 @@ ConfigJoystick(SDL_Joystick * joystick, int fd)
absinfo.value, absinfo.minimum, absinfo.maximum,
absinfo.fuzz, absinfo.flat);
#endif /* DEBUG_INPUT_EVENTS */
joystick->hwdata->hats_indices[joystick->nhats++] = hat_index;
joystick->hwdata->hats_indices[hat_index] = joystick->nhats++;
}
}
if (test_bit(REL_X, relbit) || test_bit(REL_Y, relbit)) {
Expand Down

0 comments on commit 976eee7

Please sign in to comment.