Page 1 of 1

PS4 Controller keymapping

Posted: Wed Aug 04, 2021 6:06 pm
by oatnoodles
I want to make a game that uses PS4 controllers (or any controller, really) as the main control. However I've looked online and I'm not sure if this is possible. DS4Windows exists, but I'm not sure how that could translate to Ren'Py.

Anyone know of a way to use a PS4 controller with Ren'Py games?

Re: PS4 Controller keymapping

Posted: Wed Aug 04, 2021 6:20 pm
by Ocelot
IIRC RenPy should handle both XInput and DirectInput gamepads natively.

You might need to change key mapping:
https://www.renpy.org/doc/html/keymap.html

Re: PS4 Controller keymapping

Posted: Wed Aug 04, 2021 6:33 pm
by oatnoodles
Well, I did see that, but the problem is my controller doesn't actually work when I test my game. Would it only work for the built version of the game?

Re: PS4 Controller keymapping

Posted: Wed Aug 04, 2021 9:54 pm
by Imperf3kt
Is it an official controller? Which model?
Are you connecting via usb or Bluetooth?

I haven't used it for a while, but I can confirm ps4 controllers do work with no key mapping modification necessary.

Re: PS4 Controller keymapping

Posted: Thu Aug 05, 2021 7:36 pm
by oatnoodles
To my knowledge it is an official PS4 controller, model CUH-ZCT2U. I got it at a used games store, but seems to work fine besides a few keys sticking occasionally. It's connected via USB.

Re: PS4 Controller keymapping

Posted: Thu Aug 12, 2021 6:22 am
by henvu50
I have a CUH-ZCT2U PS4 Controller. As soon as I connect it, it works with a newly created Ren'py Project. Windows 10.

Do this:
- Connect your controller.
- Click Start - Search for: Joystick
- Select: Setup USB Game Controllers
- You should see: 'Wireless Controller' (Which is the PS4 controller)
- Click properties and you can test all the buttons.

If all that works, then it should work in Ren'py. Then like Ocelot said, just use this guide to customize the bindings if you want: https://www.renpy.org/doc/html/keymap.html

Re: PS4 Controller keymapping

Posted: Mon Aug 23, 2021 1:22 pm
by oatnoodles
The thing is, my controller works everywhere *except* Ren'py. I don't know why. It just doesn't work at all when I'm testing my game.
Edit: Didn't need to follow the instructions you suggested because my controller works and is connected fine. Just doesn't work for Ren'py specifically. :-(