Gets a value indicating whether the key indicated by a UnityEngine.KeyCode was pressed this frame.
publicstaticboolGetKeyDown(KeyCodekey)
Remarks
If the Legacy Input Manager is enabled, this method wraps UnityEngine.Input.GetKeyDown(UnityEngine.KeyCode) . Otherwise, it attempts to find the UnityEngine.InputSystem.Key equivalent of key , and then checks with UnityEngine.InputSystem.Keyboard.current to find the key, and queries its UnityEngine.InputSystem.Controls.ButtonControl.wasPressedThisFrame property.
Parameters
Name
Description
KeyCode key
The UnityEngine.KeyCode to check for the state of.