What are all the joystick buttons for an Xbox 360/PC Controller?

I'm having trouble mapping all the buttons/triggers in Unity's Input settings. Can anyone help me out on this one? Here's what I have so far:

A Button joystick button 0

B Button joystick button 1

X Button joystick button 2

Y Button joystick button 3

L Button joystick button 4

R Button joystick button 5

Back joystick button 6

Start joystick button 7

Left Analog pressed joystick button 8

Right Analog pressed joystick button 9

Left Analog X Axis Joystick Axis, X Axis

Left Analog Y Axis Joystick Axis, Y Axis

Right Analog X Axis Joystick Axis, 4th Axis

Right Analog Y Axis Joystick Axis, 5th Axis

What I don't have are the left and right triggers, and the center X/Home Button

in case anyone comes here looking for more button mappings for the xbox 360 controller, here's what worked for me (using the tattie-bogle driver for osx):

D-pad up: joystick button 5
D-pad down: joystick button 6
D-pad left: joystick button 7
D-pad right: joystick button 8
start: joystick button 9
back: joystick button 10
left stick(click): joystick button 11
right stick(click): joystick button 12
left bumper: joystick button 13
right bumper: joystick button 14
center("x") button: joystick button 15
A: joystick button 16
B: joystick button 17
X: joystick button 18
Y: joystick button 19

http://wiki.unity3d.com/index.php?title=Xbox360Controller

The triggers are not buttons, they are additional analog joystick axes, either 6th and 7th, or 7th and 8th. However they operate between 0-1 instead of -1 to 1.

The home button, I am not sure about, it may be a special mapped button and not accessible.

Also, are you on a Mac, or PC? On a mac, using the open source library, the mappings may be different, as well. I haven't tested the PC bindings, so I am not sure - Tattie Bogle OSX 360 controller driver

Left/Right on D-Pad Joystick Axis, Axis 6

Up/Down on D-Pad Joystick Axis, Axis 7

Left Trigger and Right Trigger both correspond to joystick axis, axis 3

This wiki page has great diagrams of xbox 360 controllers and their input buttons.

I have a follow up question on regarding a different (but very similar) contrller.

I have a Logitech Dual Action Gamepad that has many of the same button and triggers as the XBox contrller. The 'Left Analog X/Y Axis Joystick' works just fine with no mapping, as do many of the triggers. The right analog joystick does not work. I assume I need to do something with the Logitach Profile mapping tool so that the Unity input manager associates the right anaolg joystick with two of the extra axis' (e.g. 3rd thru 8th axis).

Is that correct? How do I do that? Is there a better approach? I definately want to use the input manager and axis input as opposed to any direct input (e.g. polling analog joystick).

Thanks Don

i’ve been trying to map my xbox 360 controller to my unity project (on a mac) and am using tattie bogle’s driver as well. thanks to gyro (and a few other sources) help, i think i got it. i made a visual, for anyone else that needs it. if you see an error in here, let me know.

davebeck.org

Word of advice. unless your doing a racing game, do not use Axis 3 for the trigger. if you do, you will not be able to use both triggers at the same time. They will 0 each-other out. so it is far better to use axis 9 and 10 for the triggers.

on the chance that anyone else happens across this, I came here looking to see if i could assign my Triggers to seperate Axis/Button press through input manager, While both Axis are Joystick axis 3 they are also mapped to Other axis, i wouldn’t have even tried these if i hadn’t read above about them being 6th and 7th, However mine was Axis 9 and Axis 10. so it would appear it Differs from user to user, Hope this helps others, Definitely helped me :slight_smile:

The definitive answer is on the Unity3d wiki, with helpful illustrations, for all three PC platforms : Windows, OSX, Linux.

http://wiki.unity3d.com/index.php?title=Xbox360Controller

Buttons
Button sensitivity should be 1000

A = joystick button 0
B = joystick button 1
X = joystick button 2
Y = joystick button 3
LB = joystick button 4
RB = joystick button 5
Back = joystick joystick button 6
Start = joystick button 7
Left Analogue Press = joystick button 8
Right Analogue Press = joystick button 9

AXIS
Analog Axis sensitivity should be 1, digital should be 1000.
Left Analog Horizontal = X Axis
Left Analog Vertical = Y Axis
Triggers = 3rd Axis (Left: -1 - 0, Right: 0 - 1) _ (Left Trigger Axis: 9th, Right Trigger Axis: 10th (Both axis are 0-1))
Right Analog Horizontal = 4th axis
Right Analog Vertical = 5th axis
D-Pad Horizontal = 6th Axis
D-Pad Vertical = 7th Axis

I have a follow up question and despite hours of googling I can’t find an answer.

I can’t get any response from the left or right trigger at all under any axis.

I downloaded the input settings from the unity xbox 360 controller wiki and tried those out and I still get no response.

I even tried manually installing the xbox 360 controller drivers from microsoft.

I know the controller works, but it seems unity is not getting the input from the controller. All of the other buttons and axis’ work just fine, its the stupid triggers that won’t do anything.

I don’t know what the problem could be.

I put together a usb controller test. Things have changed drastically on the xbox one controller from the 360.

xbone summary:

| human input     | math axis | unity mapped axis | values
| --------------- | :-------: | ----------------- | -----
| left stick x    | X         | axis 3            | -1 .. 0 .. 1
| left sitck y    | Y         | axis 4            | -1 .. 0 .. 1 (inverted)
| right stick x   | X         | axis 5            | -1 .. 0 .. 1
| right stick y   | Y         | axis 6            | -1 .. 0 .. 1
| left trigger x  | X         | axis 1            | -1 or 1 
| right trigger y | Y         | axis 2            | -1 or 1 

Since I am working cross-platform on MacOSX, WebGL and Windows, I recently consolidated a list of all Possible bindings: Unity3D Xbox360 Controller Bindings.txt · GitHub

Things to note:

  • Mac is almost always completely different, both for buttons and for axis.
  • WebGL is unified on all OS (so WebGL in Mac browser will have same bindings as WebGL in Windows browser)
  • WebGL and Windows are almost identical, except that Windows can use axis 3 for an average of both triggers, and windows does not have button bindings for the dPad (while WebGL and mac both do)

I have not had a chance to test on Linux yet.

you can write a script that finds all the input names for you

   void Update()
    {

        for (int i = 1; i < 9; i++)
        {
            for (int j = 1; j < 20; j++)
            {
                if (Input.GetKeyDown("joystick " + i.ToString() + " button " + j.ToString()))
                    Debug.Log("joystick " + i.ToString() + " button " + j.ToString());
            }
        }
}