mirror of
https://github.com/yawut/SDL.git
synced 2026-07-14 15:51:25 -05:00
Don't spam events if the axis values haven't changed
This commit is contained in:
parent
211e1cb7ec
commit
8895791079
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user