From 1f45d4b614699f12fd922291d788fa79d73d1011 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 18 Mar 2014 12:33:57 -0400 Subject: [PATCH] controllermap: Don't treat SDL_HAT_CENTERED as a valid input. --- test/controllermap.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/controllermap.c b/test/controllermap.c index e6e9607ce456e..8faaf584a05f7 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;