PS4 Controller keymapping

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
oatnoodles
Regular
Posts: 71
Joined: Tue Aug 03, 2021 6:26 pm
Projects: Samuda Interval
Organization: Tomuwa Entertainment
Deviantart: oatnoodles
Github: oatnoodles
itch: oatnoodles
Discord: oatnoodles
Contact:

PS4 Controller keymapping

#1 Post 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?

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2384
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: PS4 Controller keymapping

#2 Post 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
< < insert Rick Cook quote here > >

User avatar
oatnoodles
Regular
Posts: 71
Joined: Tue Aug 03, 2021 6:26 pm
Projects: Samuda Interval
Organization: Tomuwa Entertainment
Deviantart: oatnoodles
Github: oatnoodles
itch: oatnoodles
Discord: oatnoodles
Contact:

Re: PS4 Controller keymapping

#3 Post 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?
Ren'py amateur looking to learn as much as possible! Please be patient with me.

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3785
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: PS4 Controller keymapping

#4 Post 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.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
oatnoodles
Regular
Posts: 71
Joined: Tue Aug 03, 2021 6:26 pm
Projects: Samuda Interval
Organization: Tomuwa Entertainment
Deviantart: oatnoodles
Github: oatnoodles
itch: oatnoodles
Discord: oatnoodles
Contact:

Re: PS4 Controller keymapping

#5 Post 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.
Ren'py amateur looking to learn as much as possible! Please be patient with me.

henvu50
Veteran
Posts: 337
Joined: Wed Aug 22, 2018 1:22 am
Contact:

Re: PS4 Controller keymapping

#6 Post 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

User avatar
oatnoodles
Regular
Posts: 71
Joined: Tue Aug 03, 2021 6:26 pm
Projects: Samuda Interval
Organization: Tomuwa Entertainment
Deviantart: oatnoodles
Github: oatnoodles
itch: oatnoodles
Discord: oatnoodles
Contact:

Re: PS4 Controller keymapping

#7 Post 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. :-(
Ren'py amateur looking to learn as much as possible! Please be patient with me.

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot]