src/joystick/linux/SDL_sysjoystick.c
changeset 211 0cc95f442f3a
parent 0 74212992fb08
child 221 50620ec9c86a
--- a/src/joystick/linux/SDL_sysjoystick.c	Thu Oct 18 15:07:09 2001 +0000
+++ b/src/joystick/linux/SDL_sysjoystick.c	Mon Oct 22 21:34:50 2001 +0000
@@ -143,9 +143,8 @@
 		"/dev/js%d",
 #ifdef USE_INPUT_EVENTS
 		"/dev/input/event%d"
-#else
+#endif
 		"/dev/input/js%d"
-#endif
 	};
 	int numjoysticks;
 	int i, j, done;
@@ -222,6 +221,15 @@
 				done = 1;
 			}
 		}
+        /* This is a special case...
+           If we're looking at the /dev/input event devices, and we found
+           at least one, then we don't want to look at the input joystick
+           devices, since they're built on top of devices that we've already
+           seen, so we're done.
+         */
+        if ( i > 0 && j > 0 ) {
+            done = 1;
+        }
 	}
 	return(numjoysticks);
 }