Commit graph

113 commits

Author SHA1 Message Date
Thaddeus Crews
e380a41752
Style: Add class_db.h includes explicitly 2026-02-26 15:50:28 -06:00
Stuart Carnie
f81ee0679a Input: Fix action matching for projects saved before device ID change
Normalize legacy device=0 on keyboard/mouse events when loading
input actions from project settings. Before eadec6c605, these
events defaulted to device=0; now they use DEVICE_ID_KEYBOARD (16)
and DEVICE_ID_MOUSE (32), causing _find_event() mismatches.
2026-02-21 06:27:05 +11:00
Thaddeus Crews
7eedf1846f
Merge pull request #105045 from ryevdokimov/fix-load-from-project-settings
Fix issues with `InputMap::load_from_project_settings()` when called in tool script
2026-02-16 15:02:43 -06:00
A Thousand Ships
d3924468a4
[Input] Handle invalid input/ settings correctly
This prefix is reserved for events
2026-02-03 15:38:09 +01:00
Robert Yevdokimov
bb3c8a0682 Fix issues with InputMap::load_from_project_settings() when called in tool script 2026-01-30 11:13:54 -05:00
Lukas Tenbrink
1825e89787 Change copy constructors of HashMap and AHashMap from implicit to explicit. 2026-01-21 13:01:23 +01:00
carsonuderitz@gmail.com
2fc6e11e31
Fix not releasing action when actions are erased 2025-12-12 16:27:47 +01:00
David Snopek
fc92ce3e7f Use RequiredParam/RequiredResult in some high value places 2025-12-02 10:44:12 -06:00
Thaddeus Crews
38e20331c8
Merge pull request #107303 from passivestar/close-dialog-action
Add support for closing dialog windows with Cmd+W on macOS
2025-10-22 13:48:36 -05:00
passivestar
979f8fa342 Add support for closing dialog windows with Cmd+W on macOS 2025-10-22 09:51:14 +04:00
marwen.azouzi
6dd5266a0e
Removes the need to have a display name for built-in action overrides 2025-10-21 16:45:18 +02:00
kobewi
263a2bdec6 Rework FileDialog shortcuts 2025-10-11 14:37:40 +02:00
Lukas Tenbrink
1db0a60dc0 Replace std::size usage with std_size to avoid <iterator> include. 2025-10-05 00:26:11 +02:00
kobewi
d61a337a70 Improve usage of String.split() vs get_slice() 2025-09-19 16:31:55 +02:00
Talkashie
bc7e68dfd1 Typos 2025-08-19 18:32:59 -05:00
Hugo Locurcio
b4477f3f49
Fix action name for ui_colorpicker_delete_preset in built-in InputMap
The old action name is a leftover from a now-reverted PR.
2025-06-13 02:24:34 +02:00
Haoyu Qiu
fa7efd94b3 Fix mixed use of spaces and tabs for indentation 2025-06-07 00:30:26 +08:00
kobewi
c32a031908 Improve auto-translation of Script Editor 2025-06-04 14:41:15 +02:00
Yufeng Ying
55a61cbd4a Optimize InputMap::get_actions. 2025-05-12 17:51:27 +08:00
kobewi
5af4bef46f Inline static variables (part 1) 2025-04-29 18:10:44 +02:00
Pāvels Nadtočajevs
b106dfd4f9
Base accessibility API. 2025-04-08 20:14:28 +03:00
Konrad Gadzina
e6f812c056 Modify color in ColorPicker with keyboard or joypad 2025-03-11 22:41:41 +01:00
Adam Scott
1d325847f3
Revert "Add built-in GUI to display license notices"
This reverts commit daa6198925.
2025-03-10 10:33:12 -04:00
Thaddeus Crews
3c43508ed7
Merge pull request #102427 from AThousandShips/fix_substr
Clean up some uses of `String::substr`
2025-03-07 15:12:33 -06:00
Thaddeus Crews
0c6efe572e
Merge pull request #79599 from Calinou/add-license-notices-gui
Add built-in GUI to display license notices
2025-03-07 15:12:29 -06:00
A Thousand Ships
5113022dfe
Clean up some uses of String::substr
Cases where the end position is either equvalent to the default or past
the end of the string.
2025-03-07 14:50:38 +01:00
Lukas Tenbrink
e34f1f504c Use std::size instead of sizeof(a) / sizeof(a[0]) pattern throughout the codebase. 2025-02-07 14:57:48 +01:00
Hugo Locurcio
daa6198925 Add built-in GUI to display license notices
Press Ctrl/Cmd + Shift + L (`ui_toggle_licenses_dialog` built-in action)
to show/hide the notices dialog.

The dialog can be shown via script using
`SceneTree.licenses_dialog_visible = true|false`.

Co-authored-by: MewPurPur <mew.pur.pur@abv.bg>
2025-01-27 18:35:04 +01:00
Rémi Verschelde
be4678b836
Merge pull request #95750 from mosquitochang/fix-input-event-get-index
Fix `InputMap::event_get_index` to handle unmatched events correctly
2025-01-06 22:46:37 +01:00
Thaddeus Crews
3c304ab7cc
Merge pull request #96076 from AThousandShips/improve_null_check_core_drivers
[Core,Drivers] Improve use of `Ref.is_null/valid`
2024-12-23 11:14:58 -06:00
Thaddeus Crews
8b5f181d86
Merge pull request #90723 from Calinou/textedit-autocompletion-always-replace-if-not-shift
Make TextEdit autocompletion replace word unless Shift is held
2024-11-27 10:47:24 -06:00
Markus Sauermann
bc5e2f9b96 Revert "Fix InputEvent device id clash" and add a compatibility function
This reverts commit 916d480686.

Revert "Fix InputEvent crash when opening project"
This reverts commit abb9c0f171.

Introduce a compatibility function for projects affected by the
device id clash reversal

Since the reverted PR introduced changes in the project.godot
file, it seems prudent to introduce a compatibility function for
such affected projects.
2024-11-20 09:18:55 +01:00
A Thousand Ships
68f638cf02
Use (r)find_char instead of (r)find for single characters 2024-11-17 10:02:18 +01:00
Malcolm Anderson
829dade53b Replace default deadzone magic number with named constant 2024-11-12 10:11:52 -08:00
A Thousand Ships
ec650a2f09
[Core,Drivers] Improve use of Ref.is_null/valid
Use `is_null` over `!is_valid` and vice versa.
2024-11-01 16:50:11 +01:00
A Thousand Ships
38f9769bc6
[Core] Improve error messages with vformat 2024-10-30 15:55:51 +01:00
Thaddeus Crews
ecc2eb73fc
Merge pull request #97707 from Sauermann/fix-input-device-clash
Fix `InputEvent` device id clash
2024-10-21 16:39:10 -05:00
Markus Sauermann
916d480686 Fix InputEvent device id clash
`InputMap::ALL_DEVICES` and `InputEvent::DEVICE_ID_EMULATION` have the
same value `-1`.

Change value of `InputMap::All_DEVICES` so that it's different from
`InputEvent::DEVICE_ID_EMULATION`. `InputEvent::DEVICE_ID_EMULATION`
is part of the API and can't be changed without potentially breaking
projects.

Gather all special device constants in a single location inside
`InputEvent`.

Add a converter to project settings, that takes care of adjusting
project files during loading.
2024-10-20 21:56:41 +02:00
Roman Morozov
d532eecc81 Changed the default deadzone value for new actions from 0.5 to 0.2 2024-10-01 16:47:44 +04:00
bruvzg
b776f55bcb
Add Control+Shift+U (rebindabe) action for Unicode input, show hex as it is entered. 2024-09-12 11:47:24 +03:00
mosquito chang
b32395ade9 Fix InputMap::event_get_index to handle unmatched events correctly 2024-08-18 14:46:34 +02:00
Mikael Hermansson
085f0cc50a Add Home/End to text caret movements on macOS 2024-07-08 16:08:27 +02:00
kobewi
17d3f26e5d Add event_index to InputEventAction 2024-05-30 12:51:15 +02:00
Hugo Locurcio
9558d4f28f
Make TextEdit autocompletion replace word unless Shift is held
This makes Tab and Enter act identical by default for autocompletion.

If Shift is held, the suggestion is added in-place without the word
being replaced. This matches the behavior found in Visual Studio Code
where the following occurs:

- Pressing Tab accepts the suggestion and replaces the word.
- Pressing Enter accepts the suggestion and replaces the word.
- Pressing Shift + Tab accepts the suggestion and doesn't replace the word.
- Pressing Shift + Enter accepts the suggestion and doesn't replace the word.
2024-04-16 00:21:14 +02:00
Christophe Andral
c988bec4b3 Add 'Skip to next (text) occurrence' feature to text editor
Adds `ui_text_skip_selection_for_next_occurrence` action and related implementation to text editor.
This action is bound `Ctrl+Alt+D` shorcut.

Used in conjonction with `ui_add_skip_selection_for_next_occurrence`, it gives the user the ability to select many occurrences of a selection
and avoid some of them.
Used without a previous selection, the action jumps to the next occurrence of the current word under the caret.
2024-03-25 11:12:28 +01:00
Micky
70b428041b Add autocompletion for InputMap's methods 2024-03-01 16:44:26 +01:00
Wilson E. Alvarez
a3cb1b096f
Add const references detected by clang-tidy 2023-12-16 13:36:44 -05:00
kobewi
d9d0cfaf38 Rework input actions to be reliable 2023-11-10 15:24:04 +01:00
Luc-Frédéric Langis
166ca77f20 feat(gamepad): improve gamepad behavior with slider and popup_menu 2023-06-05 10:20:46 -04:00
bruvzg
b3c64675cc
[macOS] Replace all Alt/Option+Letter/Number default shortcuts to avoid conflicts with special character input. 2023-02-20 22:02:47 +02:00