Correct joystick hat indexes on linux
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>
Tue, 04 Feb 2020 07:23:44 -0800
changeset 1347926fa8708d147
parent 13477 98899a226da5
child 13480 6a144eb5e1f1
Correct joystick hat indexes on linux
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>
src/joystick/linux/SDL_sysjoystick.c
     1.1 --- a/src/joystick/linux/SDL_sysjoystick.c	Mon Feb 03 16:38:07 2020 -0800
     1.2 +++ b/src/joystick/linux/SDL_sysjoystick.c	Tue Feb 04 07:23:44 2020 -0800
     1.3 @@ -727,7 +727,7 @@
     1.4                         absinfo.value, absinfo.minimum, absinfo.maximum,
     1.5                         absinfo.fuzz, absinfo.flat);
     1.6  #endif /* DEBUG_INPUT_EVENTS */
     1.7 -                joystick->hwdata->hats_indices[joystick->nhats++] = hat_index;
     1.8 +                joystick->hwdata->hats_indices[hat_index] = joystick->nhats++;
     1.9              }
    1.10          }
    1.11          if (test_bit(REL_X, relbit) || test_bit(REL_Y, relbit)) {