If we're looking at the /dev/input event devices, and we found
authorSam Lantinga <slouken@libsdl.org>
Mon, 22 Oct 2001 21:34:50 +0000
changeset 2110cc95f442f3a
parent 210 582abf60e21e
child 212 5e8f81418e30
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.
configure.in
src/joystick/linux/SDL_sysjoystick.c
     1.1 --- a/configure.in	Thu Oct 18 15:07:09 2001 +0000
     1.2 +++ b/configure.in	Mon Oct 22 21:34:50 2001 +0000
     1.3 @@ -930,8 +930,8 @@
     1.4  {
     1.5      dnl Check for Linux 2.4 unified input event interface support
     1.6      AC_ARG_ENABLE(input-events,
     1.7 -[  --enable-input-events   use Linux 2.4 unified input interface [default=no]],
     1.8 -                  , enable_input_events=no)
     1.9 +[  --enable-input-events   use Linux 2.4 unified input interface [default=yes]],
    1.10 +                  , enable_input_events=yes)
    1.11      if test x$enable_input_events = xyes; then
    1.12          AC_MSG_CHECKING(for Linux 2.4 unified input interface)
    1.13          use_input_events=no
     2.1 --- a/src/joystick/linux/SDL_sysjoystick.c	Thu Oct 18 15:07:09 2001 +0000
     2.2 +++ b/src/joystick/linux/SDL_sysjoystick.c	Mon Oct 22 21:34:50 2001 +0000
     2.3 @@ -143,9 +143,8 @@
     2.4  		"/dev/js%d",
     2.5  #ifdef USE_INPUT_EVENTS
     2.6  		"/dev/input/event%d"
     2.7 -#else
     2.8 +#endif
     2.9  		"/dev/input/js%d"
    2.10 -#endif
    2.11  	};
    2.12  	int numjoysticks;
    2.13  	int i, j, done;
    2.14 @@ -222,6 +221,15 @@
    2.15  				done = 1;
    2.16  			}
    2.17  		}
    2.18 +        /* This is a special case...
    2.19 +           If we're looking at the /dev/input event devices, and we found
    2.20 +           at least one, then we don't want to look at the input joystick
    2.21 +           devices, since they're built on top of devices that we've already
    2.22 +           seen, so we're done.
    2.23 +         */
    2.24 +        if ( i > 0 && j > 0 ) {
    2.25 +            done = 1;
    2.26 +        }
    2.27  	}
    2.28  	return(numjoysticks);
    2.29  }