mirror of
https://github.com/encounter/SDL.git
synced 2025-12-08 13:15:10 +00:00
On Mac OSX there are spurious hat events at program start, so skip these
This commit is contained in:
@@ -415,6 +415,11 @@ WatchJoystick(SDL_Joystick * joystick)
|
|||||||
s_nNumAxes = SDL_JoystickNumAxes(joystick);
|
s_nNumAxes = SDL_JoystickNumAxes(joystick);
|
||||||
s_arrAxisState = (AxisState *)SDL_calloc(s_nNumAxes, sizeof(*s_arrAxisState));
|
s_arrAxisState = (AxisState *)SDL_calloc(s_nNumAxes, sizeof(*s_arrAxisState));
|
||||||
|
|
||||||
|
/* Skip any spurious events at start */
|
||||||
|
while (SDL_PollEvent(&event) > 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
/* Loop, getting joystick events! */
|
/* Loop, getting joystick events! */
|
||||||
while (!done && !s_bBindingComplete) {
|
while (!done && !s_bBindingComplete) {
|
||||||
int iElement = s_arrBindingOrder[s_iCurrentBinding];
|
int iElement = s_arrBindingOrder[s_iCurrentBinding];
|
||||||
|
|||||||
Reference in New Issue
Block a user