Fixed binding D-pad on NES30 controller
authorSam Lantinga <slouken@libsdl.org>
Thu, 12 Dec 2019 19:07:26 -0800
changeset 1334799ecd178999f
parent 13346 77f3f13f4589
child 13348 448528dc13da
Fixed binding D-pad on NES30 controller
src/joystick/SDL_joystick.c
     1.1 --- a/src/joystick/SDL_joystick.c	Fri Dec 13 16:12:41 2019 -0800
     1.2 +++ b/src/joystick/SDL_joystick.c	Thu Dec 12 19:07:26 2019 -0800
     1.3 @@ -842,7 +842,7 @@
     1.4  
     1.5      info = &joystick->axes[axis];
     1.6      if (!info->has_initial_value ||
     1.7 -        (!info->has_second_value && info->initial_value == -32768 && SDL_abs(value) < (SDL_JOYSTICK_AXIS_MAX / 4))) {
     1.8 +        (!info->has_second_value && (info->initial_value == -32768 || info->initial_value == 32767) && SDL_abs(value) < (SDL_JOYSTICK_AXIS_MAX / 4))) {
     1.9          info->initial_value = value;
    1.10          info->value = value;
    1.11          info->zero = value;