2017-09-12 22:42:36 +02:00
|
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
2023-07-06 10:08:05 +02:00
|
|
|
<class name="Shortcut" inherits="Resource" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
|
2017-09-12 22:42:36 +02:00
|
|
|
<brief_description>
|
2017-11-26 20:58:38 +01:00
|
|
|
A shortcut for binding input.
|
2017-09-12 22:42:36 +02:00
|
|
|
</brief_description>
|
|
|
|
<description>
|
2021-08-03 17:27:45 +02:00
|
|
|
Shortcuts are commonly used for interacting with a [Control] element from an [InputEvent] (also known as hotkeys).
|
2021-06-21 03:34:50 +02:00
|
|
|
One shortcut can contain multiple [InputEvent]'s, allowing the possibility of triggering one action with multiple different inputs.
|
2017-09-12 22:42:36 +02:00
|
|
|
</description>
|
|
|
|
<tutorials>
|
|
|
|
</tutorials>
|
|
|
|
<methods>
|
|
|
|
<method name="get_as_text" qualifiers="const">
|
2021-07-30 15:28:05 +02:00
|
|
|
<return type="String" />
|
2017-09-12 22:42:36 +02:00
|
|
|
<description>
|
2021-06-21 03:34:50 +02:00
|
|
|
Returns the shortcut's first valid [InputEvent] as a [String].
|
2017-09-12 22:42:36 +02:00
|
|
|
</description>
|
|
|
|
</method>
|
2021-08-03 17:27:45 +02:00
|
|
|
<method name="has_valid_event" qualifiers="const">
|
2021-07-30 15:28:05 +02:00
|
|
|
<return type="bool" />
|
2017-09-12 22:42:36 +02:00
|
|
|
<description>
|
2021-06-21 03:34:50 +02:00
|
|
|
Returns whether [member events] contains an [InputEvent] which is valid.
|
2017-09-12 22:42:36 +02:00
|
|
|
</description>
|
|
|
|
</method>
|
2021-08-03 17:27:45 +02:00
|
|
|
<method name="matches_event" qualifiers="const">
|
2021-07-30 15:28:05 +02:00
|
|
|
<return type="bool" />
|
2022-08-06 20:11:48 +02:00
|
|
|
<param index="0" name="event" type="InputEvent" />
|
2017-09-12 22:42:36 +02:00
|
|
|
<description>
|
2024-09-17 12:20:36 +02:00
|
|
|
Returns whether any [InputEvent] in [member events] equals [param event]. This uses [method InputEvent.is_match] to compare events.
|
2017-09-12 22:42:36 +02:00
|
|
|
</description>
|
|
|
|
</method>
|
|
|
|
</methods>
|
|
|
|
<members>
|
2021-06-21 03:34:50 +02:00
|
|
|
<member name="events" type="Array" setter="set_events" getter="get_events" default="[]">
|
|
|
|
The shortcut's [InputEvent] array.
|
|
|
|
Generally the [InputEvent] used is an [InputEventKey], though it can be any [InputEvent], including an [InputEventAction].
|
2017-09-12 22:42:36 +02:00
|
|
|
</member>
|
|
|
|
</members>
|
|
|
|
</class>
|