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: 12
Joined: Tue May 21, 2019 2:02 pm

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

Post by Harrylechienfou » Sat Jun 15, 2019 5:25 pm

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: 121
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 » Sat Jun 15, 2019 5:56 pm

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: 12
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 » Sat Jun 15, 2019 11:05 pm

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
Citizen
Posts: 75
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 » Sun Jun 16, 2019 12:55 am

If joystick:isGamepad() returns false then you'll need to bind buttons/axes using setGamepadMapping() before any of the gamepad methods will work.
Tools: LuaPreprocess, LuaHotLoader
Games: Momento Temporis: Light from the Deep, Momento Temporis: Arena, Energize!
"If each mistake being made is a new one, then progress is being made."

User avatar
Harrylechienfou
Prole
Posts: 12
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 » Sun Jun 16, 2019 2:09 pm

Ok I see, thanks for the help !

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 7 guests