Returns true the first frame the user hits any key or mouse button. (Read Only)
// Detects if any key has been pressed down. function Update() { if(Input.anyKeyDown) Debug.Log("A key or mouse click has been detected"); }
using UnityEngine; using System.Collections; public class Example : MonoBehaviour { void Update() { if (Input.anyKeyDown) Debug.Log("A key or mouse click has been detected"); } }
import UnityEngine import System.Collections public class Example(MonoBehaviour): def Update() as void: if Input.anyKeyDown: Debug.Log('A key or mouse click has been detected')