:github_url: hide .. Generated automatically by doc/tools/makerst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the InputEventKey.xml source instead. .. The source is found in doc/classes or modules//doc_classes. .. _class_InputEventKey: InputEventKey ============= **Inherits:** :ref:`InputEventWithModifiers` **<** :ref:`InputEvent` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` Input event type for keyboard events. Description ----------- Stores key presses on the keyboard. Supports key presses, key releases and :ref:`echo` events. Tutorials --------- - :doc:`../tutorials/inputs/inputevent` Properties ---------- +-------------------------+--------------------------------------------------------+-----------+ | :ref:`bool` | :ref:`echo` | ``false`` | +-------------------------+--------------------------------------------------------+-----------+ | :ref:`bool` | :ref:`pressed` | ``false`` | +-------------------------+--------------------------------------------------------+-----------+ | :ref:`int` | :ref:`scancode` | ``0`` | +-------------------------+--------------------------------------------------------+-----------+ | :ref:`int` | :ref:`unicode` | ``0`` | +-------------------------+--------------------------------------------------------+-----------+ Methods ------- +-----------------------+--------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_scancode_with_modifiers` **(** **)** const | +-----------------------+--------------------------------------------------------------------------------------------------------------+ Property Descriptions --------------------- .. _class_InputEventKey_property_echo: - :ref:`bool` **echo** +-----------+-----------------+ | *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. ---- .. _class_InputEventKey_property_pressed: - :ref:`bool` **pressed** +-----------+--------------------+ | *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. ---- .. _class_InputEventKey_property_scancode: - :ref:`int` **scancode** +-----------+---------------------+ | *Default* | ``0`` | +-----------+---------------------+ | *Setter* | set_scancode(value) | +-----------+---------------------+ | *Getter* | get_scancode() | +-----------+---------------------+ Key scancode, one of the :ref:`KeyList` constants. ---- .. _class_InputEventKey_property_unicode: - :ref:`int` **unicode** +-----------+--------------------+ | *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 :ref:`OS.set_ime_active` for more information. Method Descriptions ------------------- .. _class_InputEventKey_method_get_scancode_with_modifiers: - :ref:`int` **get_scancode_with_modifiers** **(** **)** const Returns the scancode combined with modifier keys such as ``Shift`` or ``Alt``. See also :ref:`InputEventWithModifiers`.