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

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
Harrylechienfou
Prole
Posts: 30
Joined: Tue May 21, 2019 2:02 pm

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

Post 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 :)
MrFariator
Party member
Posts: 509
Joined: Wed Oct 05, 2016 11:53 am

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

Post 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.
User avatar
Harrylechienfou
Prole
Posts: 30
Joined: Tue May 21, 2019 2:02 pm

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

Post 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 ?
User avatar
ReFreezed
Party member
Posts: 612
Joined: Sun Oct 25, 2015 11:32 pm
Location: Sweden
Contact:

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

Post 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.
Tools: Hot Particles, LuaPreprocess, InputField, (more) Games: Momento Temporis
"If each mistake being made is a new one, then progress is being made."
User avatar
Harrylechienfou
Prole
Posts: 30
Joined: Tue May 21, 2019 2:02 pm

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

Post by Harrylechienfou »

Ok I see, thanks for the help !
Post Reply

Who is online

Users browsing this forum: No registered users and 47 guests