2
0

InputEventKey.xml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="InputEventKey" inherits="InputEventWithModifiers" version="3.4">
  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_physical_scancode_with_modifiers" qualifiers="const">
  14. <return type="int">
  15. </return>
  16. <description>
  17. Returns the physical scancode combined with modifier keys such as [code]Shift[/code] or [code]Alt[/code]. See also [InputEventWithModifiers].
  18. To get a human-readable representation of the [InputEventKey] with modifiers, use [code]OS.get_scancode_string(event.get_physical_scancode_with_modifiers())[/code] where [code]event[/code] is the [InputEventKey].
  19. </description>
  20. </method>
  21. <method name="get_scancode_with_modifiers" qualifiers="const">
  22. <return type="int">
  23. </return>
  24. <description>
  25. Returns the scancode combined with modifier keys such as [code]Shift[/code] or [code]Alt[/code]. See also [InputEventWithModifiers].
  26. 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].
  27. </description>
  28. </method>
  29. </methods>
  30. <members>
  31. <member name="echo" type="bool" setter="set_echo" getter="is_echo" default="false">
  32. If [code]true[/code], the key was already pressed before this event. It means the user is holding the key down.
  33. </member>
  34. <member name="physical_scancode" type="int" setter="set_physical_scancode" getter="get_physical_scancode" default="0">
  35. Key physical scancode, which corresponds to one of the [enum KeyList] constants. Represent the physical location of a key on the 101/102-key US QWERTY keyboard.
  36. To get a human-readable representation of the [InputEventKey], use [code]OS.get_scancode_string(event.physical_scancode)[/code] where [code]event[/code] is the [InputEventKey].
  37. </member>
  38. <member name="pressed" type="bool" setter="set_pressed" getter="is_pressed" default="false">
  39. If [code]true[/code], the key's state is pressed. If [code]false[/code], the key's state is released.
  40. </member>
  41. <member name="scancode" type="int" setter="set_scancode" getter="get_scancode" default="0">
  42. The key scancode, which corresponds to one of the [enum KeyList] constants. Represent key in the current keyboard layout.
  43. 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].
  44. </member>
  45. <member name="unicode" type="int" setter="set_unicode" getter="get_unicode" default="0">
  46. 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.
  47. </member>
  48. </members>
  49. <constants>
  50. </constants>
  51. </class>