Page 1 of 1

What are the names of RT/LT/RB/LB buttons for Love 2D ?

Posted: Sat Jun 15, 2019 5:25 pm
by Harrylechienfou
Hi, I want to use the joystick API of Love2D, but I don't know what is supposed to be the name of the RT/LT/RB/LB buttons (like, for example the name for the right arrow of the joystick is "dpright"). I want to use the function isGamepadDown. Does anyone knows ?
Is there some kind of list available somewhere, with all the names ?

Thanks for the help :)

Re: What are the names of RT/LT/RB/LB buttons for Love 2D ?

Posted: Sat Jun 15, 2019 5:56 pm
by MrFariator

Code: Select all

triggerright  - right trigger, axis value
triggerleft   - left trigger, axis value
rightshoulder - right shoulder, button value
leftshoulder  - left shoulder, button value
Axis values you get with using getGamepadAxis and button values you get with isGamepadDown. When querying the axis state, I recommend setting some minimum threshold value they must go over before they are registered as "pressed", otherwise even the slightest touch might set them off. Of course, this depends on your exact use case.

List of the axes is here, and list of buttons is here.

Re: What are the names of RT/LT/RB/LB buttons for Love 2D ?

Posted: Sat Jun 15, 2019 11:05 pm
by Harrylechienfou
Thanks ! Everything is working fine with a 360 controller, but not with an arcade stick for some reason. What is weird is that the stick is detected but it doesn't seems to be working anyway. Does the code need some kind of mapping ?

Re: What are the names of RT/LT/RB/LB buttons for Love 2D ?

Posted: Sun Jun 16, 2019 12:55 am
by ReFreezed
If joystick:isGamepad() returns false then you'll need to bind buttons/axes using setGamepadMapping() before any of the gamepad methods will work.

Re: What are the names of RT/LT/RB/LB buttons for Love 2D ?

Posted: Sun Jun 16, 2019 2:09 pm
by Harrylechienfou
Ok I see, thanks for the help !