InputEventKey.xml 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="InputEventKey" inherits="InputEventWithModifiers" version="3.3">
  3. <brief_description>
  4. Input event type for keyboard events.
  5. </brief_description>
  6. <description>
  7. Stores key presses on the keyboard. Supports key presses, key releases and [member echo] events.
  8. </description>
  9. <tutorials>
  10. <link>https://docs.godotengine.org/en/3.3/tutorials/inputs/inputevent.html</link>
  11. </tutorials>
  12. <methods>
  13. <method name="get_scancode_with_modifiers" qualifiers="const">
  14. <return type="int" />
  15. <description>
  16. Returns the scancode combined with modifier keys such as [code]Shift[/code] or [code]Alt[/code]. See also [InputEventWithModifiers].
  17. To get a human-readable representation of the [InputEventKey] with modifiers, use [code]OS.get_scancode_string(event.get_scancode_with_modifiers())[/code] where [code]event[/code] is the [InputEventKey].
  18. </description>
  19. </method>
  20. </methods>
  21. <members>
  22. <member name="echo" type="bool" setter="set_echo" getter="is_echo" default="false">
  23. If [code]true[/code], the key was already pressed before this event. It means the user is holding the key down.
  24. </member>
  25. <member name="pressed" type="bool" setter="set_pressed" getter="is_pressed" default="false">
  26. If [code]true[/code], the key's state is pressed. If [code]false[/code], the key's state is released.
  27. </member>
  28. <member name="scancode" type="int" setter="set_scancode" getter="get_scancode" default="0">
  29. The key scancode, which corresponds to one of the [enum KeyList] constants.
  30. To get a human-readable representation of the [InputEventKey], use [code]OS.get_scancode_string(event.scancode)[/code] where [code]event[/code] is the [InputEventKey].
  31. </member>
  32. <member name="unicode" type="int" setter="set_unicode" getter="get_unicode" default="0">
  33. 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 [method OS.set_ime_active] for more information.
  34. </member>
  35. </members>
  36. <constants>
  37. </constants>
  38. </class>