Skip to content

format

typescript
Input.GetKey(key)

class: Input

description

Checks if the specified key is currently being pressed in the current frame.

parameter

param_nametypedescription
keyKeyCodeThe key enumeration value.

return

typedescription
booleanWhether the key is being pressed.

code example

typescript
OnUpdate(): void {

    let result = Input.GetKey(KeyCode.Backspace);
        
    if (result) {
        Debug.Log("····Pressed Backspace key····");
    } 
}