InputEventKey.xml 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="InputEventKey" inherits="InputEventWithModifiers" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
  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>$DOCS_URL/tutorials/inputs/inputevent.html</link>
  11. </tutorials>
  12. <methods>
  13. <method name="get_physical_scancode_with_modifiers" qualifiers="const">
  14. <return type="int" />
  15. <description>
  16. Returns the physical scancode combined with modifier keys such as [kbd]Shift[/kbd] or [kbd]Alt[/kbd]. See also [InputEventWithModifiers].
  17. 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].
  18. </description>
  19. </method>
  20. <method name="get_scancode_with_modifiers" qualifiers="const">
  21. <return type="int" />
  22. <description>
  23. Returns the scancode combined with modifier keys such as [kbd]Shift[/kbd] or [kbd]Alt[/kbd]. See also [InputEventWithModifiers].
  24. 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].
  25. </description>
  26. </method>
  27. </methods>
  28. <members>
  29. <member name="echo" type="bool" setter="set_echo" getter="is_echo" default="false">
  30. If [code]true[/code], the key was already pressed before this event. It means the user is holding the key down.
  31. </member>
  32. <member name="physical_scancode" type="int" setter="set_physical_scancode" getter="get_physical_scancode" default="0">
  33. 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.
  34. 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].
  35. </member>
  36. <member name="pressed" type="bool" setter="set_pressed" getter="is_pressed" default="false">
  37. If [code]true[/code], the key's state is pressed. If [code]false[/code], the key's state is released.
  38. </member>
  39. <member name="scancode" type="int" setter="set_scancode" getter="get_scancode" default="0">
  40. The key scancode, which corresponds to one of the [enum KeyList] constants. Represent key in the current keyboard layout.
  41. 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].
  42. </member>
  43. <member name="unicode" type="int" setter="set_unicode" getter="get_unicode" default="0">
  44. 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.
  45. </member>
  46. </members>
  47. <constants>
  48. </constants>
  49. </class>