Fixed detecting the NVIDIA controller which shows up as both a mouse and a game controller
authorSam Lantinga <slouken@libsdl.org>
Wed, 01 Apr 2015 19:18:56 -0700
changeset 9454 bdc0c1dda0a4
parent 9453 49a34578d9e7
child 9455 b452e37e26d9
Fixed detecting the NVIDIA controller which shows up as both a mouse and a game controller
src/core/linux/SDL_udev.c
--- a/src/core/linux/SDL_udev.c	Thu Apr 02 00:55:45 2015 +0200
+++ b/src/core/linux/SDL_udev.c	Wed Apr 01 19:18:56 2015 -0700
@@ -350,17 +350,19 @@
             devclass |= SDL_UDEV_DEVICE_MOUSE; /* ID_INPUT_MOUSE */
         } else if (test_bit(BTN_TOUCH, bitmask_key)) {
             ; /* ID_INPUT_TOUCHSCREEN */
-        } else if (test_bit(BTN_TRIGGER, bitmask_key) ||
-                 test_bit(BTN_A, bitmask_key) ||
-                 test_bit(BTN_1, bitmask_key) ||
-                 test_bit(ABS_RX, bitmask_abs) ||
-                 test_bit(ABS_RY, bitmask_abs) ||
-                 test_bit(ABS_RZ, bitmask_abs) ||
-                 test_bit(ABS_THROTTLE, bitmask_abs) ||
-                 test_bit(ABS_RUDDER, bitmask_abs) ||
-                 test_bit(ABS_WHEEL, bitmask_abs) ||
-                 test_bit(ABS_GAS, bitmask_abs) ||
-                 test_bit(ABS_BRAKE, bitmask_abs)) {
+        }
+
+        if (test_bit(BTN_TRIGGER, bitmask_key) ||
+            test_bit(BTN_A, bitmask_key) ||
+            test_bit(BTN_1, bitmask_key) ||
+            test_bit(ABS_RX, bitmask_abs) ||
+            test_bit(ABS_RY, bitmask_abs) ||
+            test_bit(ABS_RZ, bitmask_abs) ||
+            test_bit(ABS_THROTTLE, bitmask_abs) ||
+            test_bit(ABS_RUDDER, bitmask_abs) ||
+            test_bit(ABS_WHEEL, bitmask_abs) ||
+            test_bit(ABS_GAS, bitmask_abs) ||
+            test_bit(ABS_BRAKE, bitmask_abs)) {
             devclass |= SDL_UDEV_DEVICE_JOYSTICK; /* ID_INPUT_JOYSTICK */
         }
     }