I have been using an Xbox One controller with my program with no problem. However, when I attempt to plug in a Playstation controller (Dualshock 4), the program recognizes the device but does not accept any input.
Here is how I have it set up (based on the gamepad sample):
def __init__(self):
self.gamepad = None
devices = base.devices.getDevices(InputDevice.DeviceClass.gamepad)
if devices:
self.connect(devices[0])
def connect(self, device):
"""Event handler that is called when a device is discovered."""
if device.device_class == InputDevice.DeviceClass.gamepad and not self.gamepad:
print("Found %s" % (device))
self.gamepad = device
base.attachInputDevice(device, prefix="gamepad")
This prints when I start the game:
Found Wireless Controller (connected), gamepad, 18 buttons, 8 axes