I don\'t want to use if statement. For simplicity and performance I want to use switch case and execute that method. I want all the keyboard Input to get detected. But is there
foreach(KeyCode kcode in Enum.GetValues(typeof(KeyCode))) { if (Input.GetKey(kcode)) Debug.Log("KeyCode down: " + kcode); }
Also you can cache the value of Enum.GetValues(typeof(KeyCode)) for optimization.