Trouble connecting gamepad

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

Does the same occur if you run the game with the Playstation controller connected, or does it only occur if you connect the Playstation controller after startup?

Looking at the issue from another direction, does the “device tester” gamepad sample-program respond to the Playstation controller?

The error occurs when I start the game with the controller connected, and I just tried the device tester sample, it recognized the controller but also did not accept any input

Ah, then it might be that Panda doesn’t have full support for the device. I’d suggest opening an issue for it on Panda’s GitHub site:

1 Like