Shortcut.xml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="Shortcut" inherits="Resource" version="4.0">
  3. <brief_description>
  4. A shortcut for binding input.
  5. </brief_description>
  6. <description>
  7. Shortcuts are commonly used for interacting with a [Control] element from an [InputEvent] (also known as hotkeys).
  8. One shortcut can contain multiple [InputEvent]'s, allowing the possibility of triggering one action with multiple different inputs.
  9. </description>
  10. <tutorials>
  11. </tutorials>
  12. <methods>
  13. <method name="get_as_text" qualifiers="const">
  14. <return type="String" />
  15. <description>
  16. Returns the shortcut's first valid [InputEvent] as a [String].
  17. </description>
  18. </method>
  19. <method name="has_valid_event" qualifiers="const">
  20. <return type="bool" />
  21. <description>
  22. Returns whether [member events] contains an [InputEvent] which is valid.
  23. </description>
  24. </method>
  25. <method name="matches_event" qualifiers="const">
  26. <return type="bool" />
  27. <argument index="0" name="event" type="InputEvent" />
  28. <description>
  29. Returns whether any [InputEvent] in [member events] equals [code]event[/code].
  30. </description>
  31. </method>
  32. </methods>
  33. <members>
  34. <member name="events" type="Array" setter="set_events" getter="get_events" default="[]">
  35. The shortcut's [InputEvent] array.
  36. Generally the [InputEvent] used is an [InputEventKey], though it can be any [InputEvent], including an [InputEventAction].
  37. </member>
  38. </members>
  39. </class>