Don't spam events if the axis values haven't changed
authorSam Lantinga
Tue, 11 Dec 2012 10:49:54 -0800
changeset 6735486800c3f44c
parent 6734 7fdaee2be782
child 6736 03dd4a1d06e9
Don't spam events if the axis values haven't changed
src/joystick/SDL_joystick.c
     1.1 --- a/src/joystick/SDL_joystick.c	Tue Dec 11 12:07:06 2012 -0500
     1.2 +++ b/src/joystick/SDL_joystick.c	Tue Dec 11 10:49:54 2012 -0800
     1.3 @@ -465,6 +465,9 @@
     1.4      }
     1.5  
     1.6      /* Update internal joystick state */
     1.7 +    if (value == joystick->axes[axis]) {
     1.8 +        return 0;
     1.9 +    }
    1.10      joystick->axes[axis] = value;
    1.11  
    1.12      /* Post the event, if desired */