Skip to content

Instantly share code, notes, and snippets.

@daveenguyen
Last active February 19, 2021 23:51
Show Gist options
  • Save daveenguyen/5188403 to your computer and use it in GitHub Desktop.
Save daveenguyen/5188403 to your computer and use it in GitHub Desktop.
Just using this to see where the buttons are mapped to on my controller
using UnityEngine;
using System.Collections;
public class CheckInput : MonoBehaviour {
void Update(){
if ( Input.GetKeyDown ( KeyCode.JoystickButton0 )){Debug.Log("JoystickButton0");}
if ( Input.GetKeyDown ( KeyCode.JoystickButton1 )){Debug.Log("JoystickButton1");}
if ( Input.GetKeyDown ( KeyCode.JoystickButton2 )){Debug.Log("JoystickButton2");}
if ( Input.GetKeyDown ( KeyCode.JoystickButton3 )){Debug.Log("JoystickButton3");}
if ( Input.GetKeyDown ( KeyCode.JoystickButton4 )){Debug.Log("JoystickButton4");}
if ( Input.GetKeyDown ( KeyCode.JoystickButton5 )){Debug.Log("JoystickButton5");}
if ( Input.GetKeyDown ( KeyCode.JoystickButton6 )){Debug.Log("JoystickButton6");}
if ( Input.GetKeyDown ( KeyCode.JoystickButton7 )){Debug.Log("JoystickButton7");}
if ( Input.GetKeyDown ( KeyCode.JoystickButton8 )){Debug.Log("JoystickButton8");}
if ( Input.GetKeyDown ( KeyCode.JoystickButton9 )){Debug.Log("JoystickButton9");}
if ( Input.GetKeyDown ( KeyCode.JoystickButton10 )){Debug.Log("JoystickButton10");}
if ( Input.GetKeyDown ( KeyCode.JoystickButton11 )){Debug.Log("JoystickButton11");}
if ( Input.GetKeyDown ( KeyCode.JoystickButton12 )){Debug.Log("JoystickButton12");}
if ( Input.GetKeyDown ( KeyCode.JoystickButton13 )){Debug.Log("JoystickButton13");}
if ( Input.GetKeyDown ( KeyCode.JoystickButton14 )){Debug.Log("JoystickButton14");}
if ( Input.GetKeyDown ( KeyCode.JoystickButton15 )){Debug.Log("JoystickButton15");}
if ( Input.GetKeyDown ( KeyCode.JoystickButton16 )){Debug.Log("JoystickButton16");}
if ( Input.GetKeyDown ( KeyCode.JoystickButton17 )){Debug.Log("JoystickButton17");}
if ( Input.GetKeyDown ( KeyCode.JoystickButton18 )){Debug.Log("JoystickButton18");}
if ( Input.GetKeyDown ( KeyCode.JoystickButton19 )){Debug.Log("JoystickButton19");}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment