[SerializeField] KeyCode your_key; //select a key in the inspector void Update() { if (Input.GetKey(your_key)) { print("your selected key was pressed"); } }