format
typescript
Input.GetKey(key)class: Input
description
Checks if the specified key is currently being pressed in the current frame.
parameter
| param_name | type | description |
|---|---|---|
| key | KeyCode | The key enumeration value. |
return
| type | description |
|---|---|
boolean | Whether the key is being pressed. |
code example
typescript
OnUpdate(): void {
let result = Input.GetKey(KeyCode.Backspace);
if (result) {
Debug.Log("····Pressed Backspace key····");
}
}