From c0f85de17fa5004c310bcd40f5f4d0789b225d9b Mon Sep 17 00:00:00 2001 From: Maxxus Date: Wed, 22 Jul 2015 21:58:39 -0500 Subject: [PATCH] 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. --- plugins/onepad/joystick.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/onepad/joystick.cpp b/plugins/onepad/joystick.cpp index e17fff0350..94884fdcbf 100644 --- a/plugins/onepad/joystick.cpp +++ b/plugins/onepad/joystick.cpp @@ -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