Commit 21cb42d79b8585fac1f0c9b49fe95fba47d1e3be

Sam Lantinga 2016-12-27T09:51:58

Make sure we go all the way back (within the XBox controller dead zone) to prevent accidentally binding axes inverted

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/test/controllermap.c b/test/controllermap.c
index 41cddeb..6fa6457 100644
--- a/test/controllermap.c
+++ b/test/controllermap.c
@@ -413,7 +413,7 @@ WatchJoystick(SDL_Joystick * joystick)
                     if (nCurrentDistance > nFarthestDistance) {
                         pAxisState->m_nFarthestValue = nValue;
                     }
-                    if (nCurrentDistance < 10000 && nFarthestDistance > 20000) {
+                    if (nCurrentDistance <= 8000 && nFarthestDistance >= 20000) {
                         /* We've gone out and back, let's bind this axis */
                         SDL_GameControllerExtendedBind binding;
                         SDL_zero(binding);