Skip to content

Commit

Permalink
Clarify behavior of InputEvent.is_match and Shortcut.matches_event
Browse files Browse the repository at this point in the history
- Shortcut: Clarifies how matches_event() method compares events
- InputEvent: Clarifies is_match() method does not consider event states
  • Loading branch information
SkylerGoh-dev committed Sep 17, 2024
1 parent 02b16d2 commit 4f4fd1a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions doc/classes/InputEvent.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
<description>
Returns [code]true[/code] if the specified [param event] matches this event. Only valid for action events i.e key ([InputEventKey]), button ([InputEventMouseButton] or [InputEventJoypadButton]), axis [InputEventJoypadMotion] or action ([InputEventAction]) events.
If [param exact_match] is [code]false[/code], it ignores additional input modifiers for [InputEventKey] and [InputEventMouseButton] events, and the direction for [InputEventJoypadMotion] events.
[b]Note:[/b] Only considers the event configuration (such as the keyboard key or joypad axis), not state information like [method is_pressed], [method is_released], [method is_echo], or [method is_canceled].
</description>
</method>
<method name="is_pressed" qualifiers="const">
Expand Down
2 changes: 1 addition & 1 deletion doc/classes/Shortcut.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<return type="bool" />
<param index="0" name="event" type="InputEvent" />
<description>
Returns whether any [InputEvent] in [member events] equals [param event].
Returns whether any [InputEvent] in [member events] equals [param event]. This uses [method InputEvent.is_match] to compare events.
</description>
</method>
</methods>
Expand Down

0 comments on commit 4f4fd1a

Please sign in to comment.