System.Array values = System.Enum.GetValues(typeof(KeyCode));
foreach(KeyCode code in values){
if(Input.GetKeyDown(code)){ print(System.Enum.GetName(typeof(KeyCode), code)); }
}
How do you READ or GET info from an input from a joystick/controller? - Unity Answers