Commit 1f45d4b614699f12fd922291d788fa79d73d1011

Ryan C. Gordon 2014-03-18T12:33:57

controllermap: Don't treat SDL_HAT_CENTERED as a valid input.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/test/controllermap.c b/test/controllermap.c
index e6e9607..8faaf58 100644
--- a/test/controllermap.c
+++ b/test/controllermap.c
@@ -251,6 +251,9 @@ WatchJoystick(SDL_Joystick * joystick)
                     
                     break;
                 case SDL_JOYHATMOTION:
+                        if (event.jhat.value == SDL_HAT_CENTERED) {
+                            break;  /* ignore centering, we're probably just coming back to the center from the previous item we set. */
+                        }
                         for (_s = 0; _s < s; _s++) {
                             if (steps[_s].hat == event.jhat.hat && steps[_s].hat_value == event.jhat.value) {
                                 break;