[Commits] SDL: Linux: Search a smaller set of potential joystick axes.

libsdl.org revision control commits-owner at libsdl.org
Wed Jul 13 17:38:35 PDT 2011


details:   http://hg.libsdl.org/SDL/rev/aa0e501baca0
changeset: 5562:aa0e501baca0
user:      Ryan C. Gordon <icculus at icculus.org>
date:      Wed Jul 13 17:38:09 2011 -0700
description:
Linux: Search a smaller set of potential joystick axes.

Newer kernels seem to report bogus axes in the higher ranges, for example
 with a standard PlayStation 3 controller plugged in via USB.

diffstat:

 src/joystick/linux/SDL_sysjoystick.c |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r dd0f52bf2bfa -r aa0e501baca0 src/joystick/linux/SDL_sysjoystick.c
--- a/src/joystick/linux/SDL_sysjoystick.c	Tue Jul 05 22:05:56 2011 -0400
+++ b/src/joystick/linux/SDL_sysjoystick.c	Wed Jul 13 17:38:09 2011 -0700
@@ -703,7 +703,7 @@
                 ++joystick->nbuttons;
             }
         }
-        for (i = 0; i < ABS_MAX; ++i) {
+        for (i = 0; i < ABS_MISC; ++i) {
             /* Skip hats */
             if (i == ABS_HAT0X) {
                 i = ABS_HAT3Y;


More information about the commits mailing list