Don't spam events if the axis values haven't changed
This commit is contained in:
parent
c8713a62c1
commit
5417afcf11
1 changed files with 3 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue