onepad: Minimum code needed to get Dualshock 3 working on recent linux and evdev releases.

Commit message edited by Gregory.
Comment below from Jonathan Li

On my system, /dev/input/event13 (evdev interface) and /dev/input/js0 (joystick interface) correspond to the DS3 on my system. User/group ownership are both root.

With /dev/input/event13 at 0640 and /dev/input/js0 at 0644 - SDL2 detects no pad, SDL1 detects a 19 button, 27 axis pad

With /dev/input/event13 at 0666 and /dev/input/js0 at 0644 - Both SDL1 and SDL2 report a 19 button, 4 axis pad.

SDL2 only uses the evdev interface, SDL1 uses the evdev interface but if that fails, it uses the joystick interface.
This commit is contained in:
Maxxus 2015-07-22 21:58:39 -05:00 committed by Gregory Hainaut
parent e010004f1f
commit c0f85de17f
1 changed files with 1 additions and 1 deletions

View File

@ -218,7 +218,7 @@ bool JoystickInfo::Init(int id)
// Keep the 4 hat buttons too (usb driver). (left pressure does not work with recent kernel). Moreover the pressure
// work sometime on half axis neg others time in fulll axis. So better keep them as button for the moment
u32 found_hack = devname.find(string("PLAYSTATION(R)3"));
if (found_hack != string::npos) {
if (found_hack != string::npos && numaxes > 4) {
numbuttons = 4; // (select, start, l3, r3)
// Enable this hack in bluetooth too. It avoid to restart the onepad gui
numbuttons += 4; // the 4 hat buttons