Mercurial > sdl-ios-xcode
comparison src/joystick/linux/SDL_sysjoystick.c @ 3079:cfc8b35ad6b1
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.
author | Edgar Simo <bobbens@gmail.com> |
---|---|
date | Sat, 21 Feb 2009 18:02:55 +0000 |
parents | db20dde98dd3 |
children | 0ea7b6bb4054 |
comparison
equal
deleted
inserted
replaced
3078:81d15ace9129 | 3079:cfc8b35ad6b1 |
---|---|
375 if ((ioctl(fd, EVIOCGBIT(0, sizeof(evbit)), evbit) < 0) || | 375 if ((ioctl(fd, EVIOCGBIT(0, sizeof(evbit)), evbit) < 0) || |
376 (ioctl(fd, EVIOCGBIT(EV_KEY, sizeof(keybit)), keybit) < 0) || | 376 (ioctl(fd, EVIOCGBIT(EV_KEY, sizeof(keybit)), keybit) < 0) || |
377 (ioctl(fd, EVIOCGBIT(EV_ABS, sizeof(absbit)), absbit) < 0)) { | 377 (ioctl(fd, EVIOCGBIT(EV_ABS, sizeof(absbit)), absbit) < 0)) { |
378 return (0); | 378 return (0); |
379 } | 379 } |
380 | |
380 if (!(test_bit(EV_KEY, evbit) && test_bit(EV_ABS, evbit) && | 381 if (!(test_bit(EV_KEY, evbit) && test_bit(EV_ABS, evbit) && |
381 test_bit(ABS_X, absbit) && test_bit(ABS_Y, absbit) && | 382 test_bit(ABS_X, absbit) && test_bit(ABS_Y, absbit))) { |
382 (test_bit(BTN_TRIGGER, keybit) || test_bit(BTN_A, keybit) | |
383 || test_bit(BTN_1, keybit)))) | |
384 return 0; | 383 return 0; |
384 } | |
385 return (1); | 385 return (1); |
386 } | 386 } |
387 | 387 |
388 #endif /* SDL_INPUT_LINUXEV */ | 388 #endif /* SDL_INPUT_LINUXEV */ |
389 | 389 |