mirror of
https://github.com/godotengine/godot.git
synced 2026-01-06 10:11:57 +03:00
Augment the InputEvent class with a CANCELED state
The `InputEvent` class currently supports the `pressed` and `released` states, which given the binary nature, is represented by a `bool` field. This commit introduced the `CANCELED` state, which signals that an ongoing input event has been canceled. To represent all the states, the `InputEventState` enum is added and the `InputEvent` logic is refactored accordingly.
This commit is contained in:
@@ -71,6 +71,12 @@
|
||||
Returns [code]true[/code] if this input event's type is one that can be assigned to an input action.
|
||||
</description>
|
||||
</method>
|
||||
<method name="is_canceled" qualifiers="const">
|
||||
<return type="bool" />
|
||||
<description>
|
||||
Returns [code]true[/code] if this input event has been canceled.
|
||||
</description>
|
||||
</method>
|
||||
<method name="is_echo" qualifiers="const">
|
||||
<return type="bool" />
|
||||
<description>
|
||||
@@ -84,6 +90,12 @@
|
||||
[b]Note:[/b] Due to keyboard ghosting, [method is_action_pressed] may return [code]false[/code] even if one of the action's keys is pressed. See [url=$DOCS_URL/tutorials/inputs/input_examples.html#keyboard-events]Input examples[/url] in the documentation for more information.
|
||||
</description>
|
||||
</method>
|
||||
<method name="is_released" qualifiers="const">
|
||||
<return type="bool" />
|
||||
<description>
|
||||
Returns [code]true[/code] if this input event is released. Not relevant for events of type [InputEventMouseMotion] or [InputEventScreenDrag].
|
||||
</description>
|
||||
</method>
|
||||
<method name="shortcut_match" qualifiers="const">
|
||||
<return type="bool" />
|
||||
<argument index="0" name="event" type="InputEvent" />
|
||||
|
||||
Reference in New Issue
Block a user