From 8f2299d97b7fb8c4ef03f45ce46b0d77973177e5 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 */