Inherits: InputEventWithModifiers < InputEvent < Resource < Reference < Object

Category: Core

Brief Description

Input event type for keyboard events.


bool echo false
bool pressed false
int scancode 0
int unicode 0


Stores key presses on the keyboard. Supports key presses, key releases and echo events.


Property Descriptions

Default false
Setter set_echo(value)
Getter is_echo()

If true, the key was already pressed before this event. It means the user is holding the key down.

Default false
Setter set_pressed(value)
Getter is_pressed()

If true, the key’s state is pressed. If false, the key’s state is released.

Default 0
Setter set_scancode(value)
Getter get_scancode()

Key scancode, one of the KeyList constants.

Default 0
Setter set_unicode(value)
Getter get_unicode()

Key Unicode identifier when relevant. Unicode identifiers for the composite characters and complex scripts may not be available unless IME input mode is active. See OS.set_ime_active for more information.

Method Descriptions

  • int get_scancode_with_modifiers ( ) const

Returns the scancode combined with modifier keys such as Shift or Alt. See also InputEventWithModifiers.