From 5417afcf1149d7e5a945f88038de8c6e293a1c7d Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 11 Dec 2012 10:49:54 -0800 Subject: [PATCH] Don't spam events if the axis values haven't changed --- src/joystick/SDL_joystick.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/joystick/SDL_joystick.c b/src/joystick/SDL_joystick.c index 4a7c3d7b2..1f7581ff1 100644 --- a/src/joystick/SDL_joystick.c +++ b/src/joystick/SDL_joystick.c @@ -465,6 +465,9 @@ SDL_PrivateJoystickAxis(SDL_Joystick * joystick, Uint8 axis, Sint16 value) } /* Update internal joystick state */ + if (value == joystick->axes[axis]) { + return 0; + } joystick->axes[axis] = value; /* Post the event, if desired */