Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

InputEventKey

Inherits: InputEventWithModifiers < InputEventFromWindow < InputEvent < Resource < RefCounted < Object

Represents a key on a keyboard being pressed or released.

Description

An input event for keys on a keyboard. Supports key presses, key releases and echo events. It can also be received in Node._unhandled_key_input.

Note: Events received from the keyboard usually have all properties set. Event mappings should have only one of the keycode, physical_keycode or unicode set.

When events are compared, properties are checked in the following priority - keycode, physical_keycode and unicode. Events with the first matching value will be considered equal.

Tutorials

Properties

bool

echo

false

Key

key_label

0

Key

keycode

0

Key

physical_keycode

0

bool

pressed

false

int

unicode

0

Methods