Fixes behavior of these methods:
`InputMap::event_get_action_status`
`InputEvent*::action_match`
Previously when `p_pressed` was `nullptr`, `p_strength` would be set to
`0.0f` regardless of event strength. This affected `InputEventAction` events
processed by `Input.parse_input_event` for example.
Regression found in afa89c9eea
Input buffering is implicitly used by event accumulation, but this commit makes it more generic so it can be enabled for other uses.
For desktop OSs it's currently not feasible given main and UI threads are the same).
- API has been simplified: all events now go through `parse_input_event()`. Whether they are accumulated or not depends on the `use_accumulated_input` flag.
- Event accumulation is now thread-safe (it was not needed so far, but it prepares the ground for the following changes).
- Touch drag events now support accumulation.
* Added a new macro SNAME() that constructs and caches a local stringname.
* Subsequent usages use the cached version.
* Since these use a global static variable, a second refcounter of static usages need to be kept for cleanup time.
* Replaced all theme usages by this new macro.
* Replace all signal emission usages by this new macro.
* Replace all call_deferred usages by this new macro.
This is part of ongoing work to optimize GUI and the editor.
Updates rich_text_label so that the built-in documentation can be searched
Previously, it would only find the first result and would not select other results
Renames "_entered" functions to "_submitted"
This also acts as a general-purpose "deselect" shortcut since pressing
it a second time will deselect text.
This is available both in the script editor and in TextEdit fields
in use, both in the editor and projects.
The Duplicate Line script editor shortcut was moved to Ctrl + Shift + D
since it conflicts with the new shortcut (Ctrl + D). The rationale for
doing so is that Duplicate Line is a less commonly used action, and
its behavior can be replicated by copying and pasting the current line
anyway. (With no selection active, the whole line will be copied.)
- Removes the undesired spaces before the colon
- Adds missing commas between parameters
- Adds quotes or brackets to strings
- Removes brackets around single values
We've been using standard C library functions `memcpy`/`memset` for these since
2016 with 67f65f6639.
There was still the possibility for third-party platform ports to override the
definitions with a custom header, but this doesn't seem useful anymore.
Thow errors if requesting an unexisting InputMap action.
Makes `Input.is_action_*` methods consistents with `Event.is_action_*` which already throw errors.
fixes#33303
That's the most common one we've been using for the general editor, and while the script editor
also supports Ctrl+Y, it should have lower priority.
In theory this code should make both be supported the same but for some reason the general editor
only seems to use the first entry (the script editor does support both).
This removes hardcoded actions from things like LineEdit and TextEdit.
Previously, things like copy, paste, etc were all hardcoded to Ctrl+C, Ctrl+V, etc. They could not be changed. This allows the possibility of them being changed, by making them use the action map. This has the added benefit of greatly simplifying the input handling logic in those controls. The logic which was previously in a huge and hard to follow switch statement has been extracted to individual methods.