Add "repeat" keyword alias for InputEvent "echo" in the class reference

"echo" is an uncommon term and the action is most commonly referred
to as a "repeated" key press.

This also improves the documentation related to echo behavior.
This commit is contained in:
Hugo Locurcio 2024-06-24 19:16:45 +02:00
parent 25ff1306d6
commit 4097cfa17b
No known key found for this signature in database
GPG Key ID: 39E8F8BE30B0A49C
2 changed files with 6 additions and 4 deletions

View File

@ -77,10 +77,11 @@
Returns [code]true[/code] if this input event has been canceled. Returns [code]true[/code] if this input event has been canceled.
</description> </description>
</method> </method>
<method name="is_echo" qualifiers="const"> <method name="is_echo" qualifiers="const" keywords="is_repeat">
<return type="bool" /> <return type="bool" />
<description> <description>
Returns [code]true[/code] if this input event is an echo event (only for events of type [InputEventKey]). Any other event type returns [code]false[/code]. Returns [code]true[/code] if this input event is an echo event (only for events of type [InputEventKey]). An echo event is a repeated key event sent when the user is holding down the key. Any other event type returns [code]false[/code].
[b]Note:[/b] The rate at which echo events are sent is typically around 20 events per second (after holding down the key for roughly half a second). However, the key repeat delay/speed can be changed by the user or disabled entirely in the operating system settings. To ensure your project works correctly on all configurations, do not assume the user has a specific key repeat configuration in your project's behavior.
</description> </description>
</method> </method>
<method name="is_match" qualifiers="const"> <method name="is_match" qualifiers="const">

View File

@ -59,8 +59,9 @@
</method> </method>
</methods> </methods>
<members> <members>
<member name="echo" type="bool" setter="set_echo" getter="is_echo" default="false"> <member name="echo" type="bool" setter="set_echo" getter="is_echo" default="false" keywords="repeat">
If [code]true[/code], the key was already pressed before this event. It means the user is holding the key down. If [code]true[/code], the key was already pressed before this event. An echo event is a repeated key event sent when the user is holding down the key.
[b]Note:[/b] The rate at which echo events are sent is typically around 20 events per second (after holding down the key for roughly half a second). However, the key repeat delay/speed can be changed by the user or disabled entirely in the operating system settings. To ensure your project works correctly on all configurations, do not assume the user has a specific key repeat configuration in your project's behavior.
</member> </member>
<member name="key_label" type="int" setter="set_key_label" getter="get_key_label" enum="Key" default="0"> <member name="key_label" type="int" setter="set_key_label" getter="get_key_label" enum="Key" default="0">
Represents the localized label printed on the key in the current keyboard layout, which corresponds to one of the [enum Key] constants or any valid Unicode character. Represents the localized label printed on the key in the current keyboard layout, which corresponds to one of the [enum Key] constants or any valid Unicode character.