From f99d6e1df8017ef7e9d870fdf36440e6133c6f7d Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 26 May 2015 12:03:51 -0400 Subject: [PATCH] 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 | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/joystick/linux/SDL_sysjoystick.c b/src/joystick/linux/SDL_sysjoystick.c index da5ab2a774b91..c6f7911cac51f 100644 --- a/src/joystick/linux/SDL_sysjoystick.c +++ b/src/joystick/linux/SDL_sysjoystick.c @@ -492,7 +492,7 @@ ConfigJoystick(SDL_Joystick * joystick, int fd) ++joystick->nbuttons; } } - for (i = 0; i < ABS_MISC; ++i) { + for (i = 0; i < ABS_MAX; ++i) { /* Skip hats */ if (i == ABS_HAT0X) { i = ABS_HAT3Y; @@ -753,10 +753,6 @@ HandleInputEvents(SDL_Joystick * joystick) } break; case EV_ABS: - if (code >= ABS_MISC) { - break; - } - switch (code) { case ABS_HAT0X: case ABS_HAT0Y: