mirror of
https://github.com/yawut/SDL.git
synced 2026-09-07 08:36:19 -05:00
Don't spam events if the axis values haven't changed
This commit is contained in:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user