From 0a7fe18fe6f6a30df44f2425df4bdd02f63a9081 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 17 Jan 2020 11:06:02 -0800 Subject: [PATCH] On Mac OSX there are spurious hat events at program start, so skip these --- test/controllermap.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/controllermap.c b/test/controllermap.c index 21cd4f8e6..d8e83e3b5 100644 --- a/test/controllermap.c +++ b/test/controllermap.c @@ -415,6 +415,11 @@ WatchJoystick(SDL_Joystick * joystick) s_nNumAxes = SDL_JoystickNumAxes(joystick); 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! */ while (!done && !s_bBindingComplete) { int iElement = s_arrBindingOrder[s_iCurrentBinding];