class-description NEWS COMMUNITY STORE TUTORIALS SIGN UP LOGIN LOGOUT ROKOJORI NEWSLETTER SIGN UP LOGIN LOGOUT NEWS COMMUNITY STORE TUTORIALS TOGGLE FULLSCREEN VOLLBILD AN/AUS ObjectRefCountedResourceInputEventInputEventFromWindowInputEventWithModifiers InputEventKey
Represents a key on a keyboard being pressed or released.

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().

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.

bool echo<>():bool

If true, the key was already pressed before this event. An echo event is a repeated key event sent when the user is holding down the key.

Note: The rate at which echo events are sent is typically around 20 events per second (after holding down the key for roughly half a second). However, the key repeat delay/speed can be changed by the user or disabled entirely in the operating system settings. To ensure your project works correctly on all configurations, do not assume the user has a specific key repeat configuration in your project's behavior.

Key key_label<>():Key

Represents the localized label printed on the key in the current keyboard layout, which corresponds to one of the Key constants or any valid Unicode character.

For keyboard layouts with a single label on the key, it is equivalent to keycode.

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

+-----+ +-----+
| Q   | | Q   | - "Q" - keycode
|   Й | |  ض | - "Й" and "ض" - key_label
+-----+ +-----+
Key keycode<>():Key

Latin label printed on the key in the current keyboard layout, which corresponds to one of the Key constants.

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

+-----+ +-----+
| Q   | | Q   | - "Q" - keycode
|   Й | |  ض | - "Й" and "ض" - key_label
+-----+ +-----+
KeyLocation location<>():KeyLocation

Represents the location of a key which has both left and right versions, such as Shift or Alt.

Key physical_keycode<>():Key

Represents the physical location of a key on the 101/102-key US QWERTY keyboard, which corresponds to one of the Key constants.

To get a human-readable representation of the InputEventKey, use OS.get_keycode_string() in combination with DisplayServer.keyboard_get_keycode_from_physical():

func _input(event): if event is InputEventKey: var keycode = DisplayServer.keyboard_get_keycode_from_physical(event.physical_keycode) print(OS.get_keycode_string(keycode))
bool pressed<>():bool

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

int unicode<>():int

The key Unicode character code (when relevant), shifted by modifier keys. Unicode character codes for composite characters and complex scripts may not be available unless IME input mode is active. See Window.set_ime_active() for more information.

String as_text_key_label<>():String

Returns a String representation of the event's key_label and modifiers.

String as_text_keycode<>():String

Returns a String representation of the event's keycode and modifiers.

String as_text_location<>():String

Returns a String representation of the event's location. This will be a blank string if the event is not specific to a location.

String as_text_physical_keycode<>():String

Returns a String representation of the event's physical_keycode and modifiers.

Key get_key_label_with_modifiers<>():Key

Returns the localized key label 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_keycode_string(event.get_key_label_with_modifiers()) where event is the InputEventKey.

Key get_keycode_with_modifiers<>():Key

Returns the Latin keycode 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_keycode_string(event.get_keycode_with_modifiers()) where event is the InputEventKey.

Key get_physical_keycode_with_modifiers<>():Key

Returns the physical keycode 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_keycode_string(event.get_physical_keycode_with_modifiers()) where event is the InputEventKey.




All social media brands are registrated trademarks and belong to their respective owners.





CONTACT IMPRINT TERMS OF USE PRIVACY © ROKOROJI ® 2021 rokojori.com
CONTACT IMPRINT TERMS OF USE PRIVACY © ROKOROJI ® 2021 rokojori.com
We are using cookies on this site. Read more... Wir benutzen Cookies auf dieser Seite. Mehr lesen...