diff --git a/src/joystick/linux/SDL_sysjoystick.c b/src/joystick/linux/SDL_sysjoystick.c index a06170726..e8d4b6150 100644 --- a/src/joystick/linux/SDL_sysjoystick.c +++ b/src/joystick/linux/SDL_sysjoystick.c @@ -659,6 +659,9 @@ ConfigJoystick(SDL_Joystick * joystick, int fd) unsigned long relbit[NBITS(REL_MAX)] = { 0 }; unsigned long ffbit[NBITS(FF_MAX)] = { 0 }; + SDL_JoystickGUID guid = SDL_JoystickGetGUID(joystick); + char pandoryGUID[1024]; + /* See if this device uses the new unified event API */ if ((ioctl(fd, EVIOCGBIT(EV_KEY, sizeof(keybit)), keybit) >= 0) && (ioctl(fd, EVIOCGBIT(EV_ABS, sizeof(absbit)), absbit) >= 0) && @@ -683,6 +686,7 @@ ConfigJoystick(SDL_Joystick * joystick, int fd) ++joystick->nbuttons; } } + for (i = 0; i < ABS_MISC; ++i) { /* Skip hats */ if (i == ABS_HAT0X) { @@ -695,6 +699,18 @@ ConfigJoystick(SDL_Joystick * joystick, int fd) if (ioctl(fd, EVIOCGABS(i), &absinfo) < 0) { continue; } + + // Pandory500 retrogames-udev-bug skip more than two axes + SDL_JoystickGetGUIDString(joystick->hwdata->guid, pandoryGUID, sizeof(pandoryGUID)); + if ( strcmp(pandoryGUID, "03000000591c00002600000010010000") == 0 // 'Retro Games LTD THEGamepad' + || strcmp(pandoryGUID, "03000000591c00002300000010010000") == 0 // ' THEC64 Joystick THEC64 Joystick ' + ) { + if (i > 1) { + printf("Pandory: retrogames-udev-bug - skipping absolute axis: 0x%.2x\n", i); + continue; + } + } + #ifdef DEBUG_INPUT_EVENTS printf("Joystick has absolute axis: 0x%.2x\n", i); printf("Values = { %d, %d, %d, %d, %d }\n",