changeset 211:0cc95f442f3a

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.
author Sam Lantinga <slouken@libsdl.org>
date Mon, 22 Oct 2001 21:34:50 +0000
parents 582abf60e21e
children 5e8f81418e30
files configure.in src/joystick/linux/SDL_sysjoystick.c
diffstat 2 files changed, 12 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/configure.in	Thu Oct 18 15:07:09 2001 +0000
+++ b/configure.in	Mon Oct 22 21:34:50 2001 +0000
@@ -930,8 +930,8 @@
 {
     dnl Check for Linux 2.4 unified input event interface support
     AC_ARG_ENABLE(input-events,
-[  --enable-input-events   use Linux 2.4 unified input interface [default=no]],
-                  , enable_input_events=no)
+[  --enable-input-events   use Linux 2.4 unified input interface [default=yes]],
+                  , enable_input_events=yes)
     if test x$enable_input_events = xyes; then
         AC_MSG_CHECKING(for Linux 2.4 unified input interface)
         use_input_events=no
--- 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);
 }