Welcome to the Godot Reference Fork and the Godot Proposals Fork alternatives. Why?

InputEventKey

0 0 vote
Article Rating

Inherits: InputEventWithModifiers < InputEvent < Resource < Reference < Object

Input event type for keyboard events.

Description

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

Tutorials

Property Descriptions

Defaultfalse
Setterset_echo(value)
Getteris_echo()

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


Defaultfalse
Setterset_pressed(value)
Getteris_pressed()

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


Default0
Setterset_scancode(value)
Getterget_scancode()

The key scancode, which corresponds to one of the KeyList constants.

To get a human-readable representation of the InputEventKey, use OS.get_scancode_string(event.scancode) where event is the InputEventKey.


Default0
Setterset_unicode(value)
Getterget_unicode()

The 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.

To get a human-readable representation of the InputEventKey with modifiers, use OS.get_scancode_string(event.get_scancode_with_modifiers()) where event is the InputEventKey.

Doc ID missing

Disclaimer: This page has been automaticaly and directly extracted from the official Godot Docs website, the 1970-01-01 at 00:00:00. It’s the English Stable version because it’s what most Godot users should use. The Copyright owners are Juan Linietsky, Ariel Manzur and the Godot community. CC-BY 3.0. Thanks for your patience and generosity.

Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x