Search Unity

Heres all the buttons for a gamepad for Android.

Discussion in 'Android' started by vagelis199, Aug 22, 2019.

  1. vagelis199

    vagelis199

    Joined:
    Jul 27, 2012
    Posts:
    183
    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.
     
    Last edited: Jan 4, 2022
    AcidArrow, Xender1, mtozsahin and 7 others like this.
  2. WhosTheBoss

    WhosTheBoss

    Joined:
    Jan 8, 2013
    Posts:
    64

    Attached Files:

  3. WhosTheBoss

    WhosTheBoss

    Joined:
    Jan 8, 2013
    Posts:
    64
    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.
     
    vagelis199 likes this.
  4. vagelis199

    vagelis199

    Joined:
    Jul 27, 2012
    Posts:
    183
    Im happy it worked for you!
     
  5. Realform

    Realform

    Joined:
    Mar 20, 2015
    Posts:
    9
    Any chance that this may work inside an Oculus GO? i really can not afford right now a new xbox one S controller
     
  6. vagelis199

    vagelis199

    Joined:
    Jul 27, 2012
    Posts:
    183
    Works with any controller really.
     
  7. jakojin

    jakojin

    Joined:
    Dec 27, 2019
    Posts:
    1
    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?
     
  8. cavila31

    cavila31

    Joined:
    Apr 14, 2021
    Posts:
    1
    Thanks so much for making this app, I think you saved my project (and my grade for the class the project is for)!
     
  9. abj2023

    abj2023

    Joined:
    May 21, 2013
    Posts:
    11
    Has anyone gotten this to detect the inputs of pass through USB-C gamepads like the Razer Kishi?
     
  10. thebitmaster

    thebitmaster

    Joined:
    Oct 4, 2016
    Posts:
    5
    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 @vagelis199!