Fixed haptic subsystem on linux 2.6.28 by lowering the EV_IsJoystick check (seems like some stuff was changed). Shouldn't break anything with earlier versions. Might need to be more robust if false positives show up.
authorEdgar Simo <bobbens@gmail.com>
Sat, 21 Feb 2009 18:02:55 +0000
changeset 3079cfc8b35ad6b1
parent 3078 81d15ace9129
child 3080 4094b4f1c3a1
Fixed haptic subsystem on linux 2.6.28 by lowering the EV_IsJoystick check (seems like some stuff was changed). Shouldn't break anything with earlier versions. Might need to be more robust if false positives show up.
src/joystick/linux/SDL_sysjoystick.c
     1.1 --- a/src/joystick/linux/SDL_sysjoystick.c	Thu Feb 19 06:49:59 2009 +0000
     1.2 +++ b/src/joystick/linux/SDL_sysjoystick.c	Sat Feb 21 18:02:55 2009 +0000
     1.3 @@ -377,11 +377,11 @@
     1.4          (ioctl(fd, EVIOCGBIT(EV_ABS, sizeof(absbit)), absbit) < 0)) {
     1.5          return (0);
     1.6      }
     1.7 +
     1.8      if (!(test_bit(EV_KEY, evbit) && test_bit(EV_ABS, evbit) &&
     1.9 -          test_bit(ABS_X, absbit) && test_bit(ABS_Y, absbit) &&
    1.10 -          (test_bit(BTN_TRIGGER, keybit) || test_bit(BTN_A, keybit)
    1.11 -           || test_bit(BTN_1, keybit))))
    1.12 +          test_bit(ABS_X, absbit) && test_bit(ABS_Y, absbit))) {
    1.13          return 0;
    1.14 +    }
    1.15      return (1);
    1.16  }
    1.17