controllermap: Don't treat SDL_HAT_CENTERED as a valid input.
authorRyan C. Gordon <icculus@icculus.org>
Tue, 18 Mar 2014 12:33:57 -0400
changeset 8631 2ce6d7f3cf40
parent 8630 e217ed463f25
child 8632 ee8764423724
controllermap: Don't treat SDL_HAT_CENTERED as a valid input.
test/controllermap.c
--- a/test/controllermap.c	Tue Mar 18 12:08:49 2014 -0400
+++ b/test/controllermap.c	Tue Mar 18 12:33:57 2014 -0400
@@ -251,6 +251,9 @@
                     
                     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;