Don't spam events if the axis values haven't changed

This commit is contained in:
Sam Lantinga 2012-12-11 10:49:54 -08:00
parent c8713a62c1
commit 5417afcf11

View file

@ -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 */