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:
Fredia Huya-Kouadio
2023-05-03 17:57:13 -07:00
parent cf8ad12b56
commit 250749fa79
8 changed files with 83 additions and 76 deletions

View File

@@ -11,6 +11,9 @@
<link title="InputEvent">$DOCS_URL/tutorials/inputs/inputevent.html</link>
</tutorials>
<members>
<member name="canceled" type="bool" setter="set_canceled" getter="is_canceled" default="false">
If [code]true[/code], the touch event has been canceled.
</member>
<member name="double_tap" type="bool" setter="set_double_tap" getter="is_double_tap" default="false">
If [code]true[/code], the touch's state is a double tap.
</member>