/Godot 3.1


Inherits: InputEventWithModifiers < InputEvent < Resource < Reference < Object

Category: Core

Brief Description

Input event type for keyboard events.


bool echo
bool pressed
int scancode
int unicode


int get_scancode_with_modifiers ( ) const


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


Property Descriptions

bool echo

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.

bool pressed

Setter set_pressed(value)
Getter is_pressed()

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

int scancode

Setter set_scancode(value)
Getter get_scancode()

Key scancode, one of the KEY_* constants in @GlobalScope.

int unicode

Setter set_unicode(value)
Getter get_unicode()

Key unicode identifier when relevant.

Method Descriptions

int get_scancode_with_modifiers ( ) const

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

© 2014–2019 Juan Linietsky, Ariel Manzur, Godot Engine contributors
Licensed under the MIT License.