src/joystick/linux/SDL_sysjoystick.c
changeset 211 0cc95f442f3a
parent 0 74212992fb08
child 221 50620ec9c86a
     1.1 --- a/src/joystick/linux/SDL_sysjoystick.c	Thu Oct 18 15:07:09 2001 +0000
     1.2 +++ b/src/joystick/linux/SDL_sysjoystick.c	Mon Oct 22 21:34:50 2001 +0000
     1.3 @@ -143,9 +143,8 @@
     1.4  		"/dev/js%d",
     1.5  #ifdef USE_INPUT_EVENTS
     1.6  		"/dev/input/event%d"
     1.7 -#else
     1.8 +#endif
     1.9  		"/dev/input/js%d"
    1.10 -#endif
    1.11  	};
    1.12  	int numjoysticks;
    1.13  	int i, j, done;
    1.14 @@ -222,6 +221,15 @@
    1.15  				done = 1;
    1.16  			}
    1.17  		}
    1.18 +        /* This is a special case...
    1.19 +           If we're looking at the /dev/input event devices, and we found
    1.20 +           at least one, then we don't want to look at the input joystick
    1.21 +           devices, since they're built on top of devices that we've already
    1.22 +           seen, so we're done.
    1.23 +         */
    1.24 +        if ( i > 0 && j > 0 ) {
    1.25 +            done = 1;
    1.26 +        }
    1.27  	}
    1.28  	return(numjoysticks);
    1.29  }