0 votes

I would like to try to remap or debug gamepad controllers and was told that I can test the mapping by using this code:

void add_joy_mapping( String mapping, bool update_existing=false )

Right now I have no idea how it works but I would like to try to use it in order to remap any gamepad controller buttons or joysticks for debugging purposes.

Any ideas on how that small line of code is appropriately used?

in Engine by (208 points)

1 Answer

0 votes

It's used with SDL mappings.

here is an example of one I use.

    Input.add_joy_mapping("03000000ad1b000000f9000000010000,360 Afterglow,a:b0,b:b1,x:b2,y:b3,back:b6,guide:b8,start:b7,leftstick:b9,rightstick:b10,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:a2,righttrigger:a5,platform:Linux,", true)

To get the string I used this tool. http://generalarcade.com/gamepadtool/

by (14 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.