Heres all the buttons for a gamepad for Android

Hello guys! I been struggling a long time now to understand on how an xinput controller registers its buttons on a Unity Android game, Just because the input key codes are not the same on an Android build with a Windows build, making the buttons scrambled and usually not working correctly. And there’s no guide online, i made this simple app which gonna help you easily assign your key codes for your mobile game.

All you have to do is download the free app from Google Play (its ad-free as well), and connect your Bluetooth controller or even an OTG cable, there’s a visual representation of an xbox controller and it gonna log any button your press or axis u move on your controller which you can input on your code or input manager right away.

Unity Android Controller Logger
App Link https://play.google.com/store/apps/details?id=com.Evag.UACL

Don’t wanna download the app?

Here is every button key code for xinput gamepad on Android.

A = joystick 1 button 0
B = joystick 1 button 1
X = joystick 1 button 2
Y = joystick 1 button 3

LB = joystick 1 button 4
RB = joystick 1 button 5
LT = joystick 1 button 6
RT = joystick 1 button 7
L3 = joystick 1 button 8
R3 = joystick 1 button 9

START = joystick 1 button 10
BACK = joystick 1 button 11

Left Analog Stick X = Axis 1
Left Analog Stick Y = Axis 2 (inverted)

Right Analog Stick X = Axis 3
Right Analog Stick Y = Axis 4 (inverted)

Dpad X = Axis 5
Dpad Y = Axis 6 (inverted)

I hope this help alot of people.

10 Likes

Dude,

this is PERFECT! As i’ve been trying to figure out how to use a USB controller on my Unity Android Game.

I have a question for you. Do you know if this will work with those DIY arcade kits?
I want buy this:Amazon.com: Hikig 2 Player led arcade buttons and joysticks DIY kit 2x joysticks + 20x led arcade buttons game controller kit for MAME and Raspberry Pi - Red + Blue Color : Video Games

And wanted to know if it’ll work on Android?

SOLVED: It works. I bought the Arcade kit and Unity can read the Arcade kit buttons and joy stick. The Arcade kit is basically a USB controller.

1 Like

Im happy it worked for you!

Any chance that this may work inside an Oculus GO? i really can not afford right now a new xbox one S controller

Works with any controller really.

Hi
i did test it
But, this app couldn’t read LT(left trigger) button and RT(right trigger) button.
Does Android support LT button and RT button?

Thanks so much for making this app, I think you saved my project (and my grade for the class the project is for)!

Has anyone gotten this to detect the inputs of pass through USB-C gamepads like the Razer Kishi?

Yes. I just tried it with my new Razer Kishi on my LG Thinq G7 and it successfully maps every control! That will save me days of work! Thanks @vagelis1991 !