Files
buildroot/package/sdl/sdl-joystick-fix-deadzone.patch
2019-09-25 20:52:32 -03:00

17 lines
477 B
Diff

diff --git a/src/joystick/SDL_joystick.c b/src/joystick/SDL_joystick.c
index 083b017..a4c36db 100644
--- a/src/joystick/SDL_joystick.c
+++ b/src/joystick/SDL_joystick.c
@@ -438,6 +438,11 @@ int SDL_PrivateJoystickAxis(SDL_Joystick *joystick, Uint8 axis, Sint16 value)
return 0;
}
+ /* Don't update if we're in the dead zone */
+ if ( value == 0 && joystick->axes[axis] == 0 ) {
+ return 0;
+ }
+
/* Update internal joystick state */
joystick->axes[axis] = value;