Linux joystick: Look at entire axis namespace for controls (thanks, "spaz16"!).
authorRyan C. Gordon <icculus@icculus.org>
Tue, 26 May 2015 12:03:51 -0400
changeset 96306c86d3216f6a
parent 9629 9242a9b29c7d
child 9631 e015da7884df
Linux joystick: Look at entire axis namespace for controls (thanks, "spaz16"!).

This apparently has fallout: the PS4 (and maybe PS3?) controllers apparently
report some bogus axes, but it won't change the axes we currently expect, and
thus the game controller config string is still stable.

Fixes Bugzilla #2719.
src/joystick/linux/SDL_sysjoystick.c
     1.1 --- a/src/joystick/linux/SDL_sysjoystick.c	Tue May 26 08:52:02 2015 -0700
     1.2 +++ b/src/joystick/linux/SDL_sysjoystick.c	Tue May 26 12:03:51 2015 -0400
     1.3 @@ -492,7 +492,7 @@
     1.4                  ++joystick->nbuttons;
     1.5              }
     1.6          }
     1.7 -        for (i = 0; i < ABS_MISC; ++i) {
     1.8 +        for (i = 0; i < ABS_MAX; ++i) {
     1.9              /* Skip hats */
    1.10              if (i == ABS_HAT0X) {
    1.11                  i = ABS_HAT3Y;
    1.12 @@ -753,10 +753,6 @@
    1.13                  }
    1.14                  break;
    1.15              case EV_ABS:
    1.16 -                if (code >= ABS_MISC) {
    1.17 -                    break;
    1.18 -                }
    1.19 -
    1.20                  switch (code) {
    1.21                  case ABS_HAT0X:
    1.22                  case ABS_HAT0Y: