Mercurial > sdl-ios-xcode
diff src/joystick/linux/SDL_sysjoystick.c @ 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 | 74212992fb08 |
children | 50620ec9c86a |
line wrap: on
line diff
--- 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); }