]> Shamusworld >> Repos - virtualjaguar/commitdiff
Fix for PS3 controllers.
authorShamus Hammons <jlhamm@acm.org>
Wed, 8 Oct 2014 21:37:04 +0000 (16:37 -0500)
committerShamus Hammons <jlhamm@acm.org>
Wed, 8 Oct 2014 21:37:04 +0000 (16:37 -0500)
src/gui/gamepad.cpp

index 4615c82e0880ac8fa1cbab06c75a6f1fd32fbfe6..873e3b5ad9a81d2efc0f3f7c186a256336fa2d22 100644 (file)
@@ -64,6 +64,15 @@ void Gamepad::AllocateJoysticks(void)
                        numHats[i] = SDL_JoystickNumHats(pad[i]);
                        numAxes[i] = SDL_JoystickNumAxes(pad[i]);
                        WriteLog("Gamepad: Joystick #%i: %s\n", i, padName[i]);
+
+                       // Ick, kludges already!!!
+                       if (strcmp(padName[i], "Sony PLAYSTATION(R)3 Controller") == 0)
+                       {
+                               // We do this because these axes stay stuck on -32000 (buttons)
+                               // or come on and stay on (D-pad). :-P
+                               numAxes[i] = 8;
+                               WriteLog("Gamepad: Blacklisting PS3 controller axes 8 on up...\n");
+                       }
                }
        }