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.