Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Don't spam events if the axis values haven't changed
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Dec 11, 2012
1 parent 9df023d commit 8f2299d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/joystick/SDL_joystick.c
Expand Up @@ -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 */
Expand Down

0 comments on commit 8f2299d

Please sign in to comment.