using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class KeyCodeDemo : MonoBehaviour { public Text text; void Update() { if (Input.anyKeyDown) { foreach (KeyCode keyCode in Enum.GetValues(typeof(KeyCode))) { if (Input.GetKeyDown(keyCode)) { text.text = "Current Key is : " + keyCode.ToString(); } } } } }