summaryrefslogtreecommitdiffstats
path: root/core/input/input_map.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix copyright headers referring to GodotSpartan3222024-10-271-2/+2
|
* Rebrand preambles to RedotSpartan3222024-10-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | (cherry picked from commit e8542b06acca3c1bdeee4b528411771f0819f084) Credits: Co-authored-by: Skogi <skogi.b@gmail.com> Co-authored-by: Spartan322 <Megacake1234@gmail.com> Co-authored-by: swashberry <swashdev@pm.me> Co-authored-by: Christoffer Sundbom <christoffer_karlsson@live.se> Co-authored-by: Dubhghlas McLaughlin <103212704+mcdubhghlas@users.noreply.github.com> Co-authored-by: McDubh <103212704+mcdubhghlas@users.noreply.github.com> Co-authored-by: Dubhghlas McLaughlin <103212704+mcdubhghlas@users.noreply.github.com> Co-authored-by: radenthefolf <radenthefolf@gmail.com> Co-authored-by: John Knight <80524176+Tekisasu-JohnK@users.noreply.github.com> Co-authored-by: Adam Vondersaar <adam.vondersaar@uphold.com> Co-authored-by: decryptedchaos <nixgod@gmail.com> Co-authored-by: zaftnotameni <122100803+zaftnotameni@users.noreply.github.com> Co-authored-by: Aaron Benjamin <lifeartstudios@gmail.com> Co-authored-by: wesam <108880473+wesamdev@users.noreply.github.com> Co-authored-by: Mister Puma <MisterPuma80@gmail.com> Co-authored-by: Aaron Benjamin <lifeartstudios@gmail.com> Co-authored-by: SingleError <isaaconeoneone@gmail.com> Co-authored-by: Bioblaze Payne <BioblazePayne@gmail.com>
* Add Home/End to text caret movements on macOSMikael Hermansson2024-07-081-0/+4
|
* Add event_index to InputEventActionkobewi2024-05-301-0/+7
|
* Add 'Skip to next (text) occurrence' feature to text editorChristophe Andral2024-03-251-0/+5
| | | | | | | | | 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.
* Add autocompletion for InputMap's methodsMicky2024-03-011-0/+29
|
* Add const references detected by clang-tidyWilson E. Alvarez2023-12-161-2/+2
|
* Rework input actions to be reliablekobewi2023-11-101-3/+15
|
* feat(gamepad): improve gamepad behavior with slider and popup_menuLuc-Frédéric Langis2023-06-051-0/+4
|
* [macOS] Replace all `Alt/Option+Letter/Number` default shortcuts to avoid ↵bruvzg2023-02-201-0/+4
| | | | conflicts with special character input.
* Improvements and fixes based on Weblate commentsHaoyu Qiu2023-02-131-1/+1
| | | | | | | | | | | | | | | | | | | * Description of `ui_text_submit` action should be "Submit Text" instead of "Text Submitted". * Spell out "Animation" instead of using "Anim.". * Treat "Max" as regular word instead of writing "Max.". * Use generic "Set %s" for action name instead of a dedicated "Set target_position". * Add translator comment for: * "Inclusive" and "Self" in the profiler. * Places where it needs the context about being an editor progress label. * "Duplicated Animation Name" since it's refering to the new name of a duplicated animation. * Disambiguation of "View Plane Transform", "Paste Selects" and "Display Normal". * Fix wrong undo action name for renaming an input action. * Fix missing end quote in a shader error message. * In class reference: * Fix duplicated "if" in the description of `signf()`. * Fix mismatched example output in `String.operator %()`. * Fix typo in the description of `Decal.texture_emission`. * Unify description of `String.match()` and `StringName.match()`.
* One Copyright Update to rule them allRémi Verschelde2023-01-051-29/+29
| | | | | | | | | | | | | | | | | | | | As many open source projects have started doing it, we're removing the current year from the copyright notice, so that we don't need to bump it every year. It seems like only the first year of publication is technically relevant for copyright notices, and even that seems to be something that many companies stopped listing altogether (in a version controlled codebase, the commits are a much better source of date of publication than a hardcoded copyright statement). We also now list Godot Engine contributors first as we're collectively the current maintainers of the project, and we clarify that the "exclusive" copyright of the co-founders covers the timespan before opensourcing (their further contributions are included as part of Godot Engine contributors). Also fixed "cf." Frenchism - it's meant as "refer to / see".
* Unified shortcut to clear carets and selectionsAlfred Reinold Baudisch2022-11-021-2/+2
| | | | | | | | | Refactors`ui_text_remove_secondary_carets` from https://github.com/godotengine/godot/pull/68089 as `ui_text_clear_carets_and_selection`, with extra behaviour: - If there's only one active caret active with a selection, clears the selection. - In case there's more than one caret active, removes the secondary carets and clears selections. With this change, `TextEdit` then imitates the behaviour of VSCode for clearing carets and selections.
* Shortcut and Bind to Remove Secondary CaretsAlfred Reinold Baudisch2022-10-311-0/+5
| | | | | | | | | | Adds the bind `ui_text_remove_secondary_carets` to TextEdit, with ESC as the default shortcut. When the bind is performed, if the TextEdit has multiple carets, `remove_secondary_carets` is called and secondary carets are removed. This is useful when multiple selects are performed with `add_select_for_next_occurrence` #67644 or when multiple multiple carets are manually added, then it's possible to go back to a single caret with a shortcut. Closes #67991
* Merge pull request #67578 from KoBeWi/GEDITORRémi Verschelde2022-10-311-1/+1
|\ | | | | | | Unify usage of GLOBAL/EDITOR_GET
| * Unify usage of GLOBAL/EDITOR_GETkobewi2022-10-181-1/+1
| |
* | Merge pull request #67139 from PucklaMotzer09/insert_caret_at_caretsRémi Verschelde2022-10-311-0/+22
|\ \ | | | | | | | | | Add Caret Insert Below and Above shortcuts to TextEdit
| * | Add Caret Insert Below and Above shortcuts to TextEditPucklaMotzer092022-10-181-0/+22
| |/
* / Add Selection and Caret for Next Occurrence of SelectionAlfred Reinold Baudisch2022-10-211-1/+6
|/ | | | | | | | | | | | | | Adds the bind `add_selection_for_next_occurrence` to TextEdit, with CTRL+D as the default shortcut. When the bind is performed, ff a selection is currently active with the last caret in text fields, searches for the next occurrence of the selection, adds a caret and selects the next occurrence. If no selection is currently active with the last caret in text fields, selects the word currently under the caret. The action can be performed sequentially for all occurrences of the selection of the last caret and for all existing carets. The viewport is adjusted to the latest newly added caret. The bind and the behaviour is similar to VS Code's "Add Selection to Next Find Match" and JetBrains' "Add Selection for Next Occurrence". It takes advantage of the multi-caret API. The default shortcut for `select_word_under_caret` has been changed to ALT+G, in order to give priority to CTRL+D for `add_selection_for_next_occurrence` to better align with popular IDEs and editors.
* Fix key mapping changes when moving from macOS to other platformbruvzg2022-09-071-31/+31
| | | | | Removes separate `Command` key (use `Meta` instead). Adds an event flag to automatically remap `Command` <-> `Control` (cannot be set alongside `Control` or `Meta`).
* Replace Array return types with TypedArray 2kobewi2022-08-231-4/+5
|
* Replace most uses of Map by HashMapreduz2022-05-161-2/+2
| | | | | | | | | | | | * Map is unnecessary and inefficient in almost every case. * Replaced by the new HashMap. * Renamed Map to RBMap and Set to RBSet for cases that still make sense (order matters) but use is discouraged. There were very few cases where replacing by HashMap was undesired because keeping the key order was intended. I tried to keep those (as RBMap) as much as possible, but might have missed some. Review appreciated!
* Add a new HashMap implementationreduz2022-05-121-20/+20
| | | | | | | | | | | | | | | | | Adds a new, cleaned up, HashMap implementation. * Uses Robin Hood Hashing (https://en.wikipedia.org/wiki/Hash_table#Robin_Hood_hashing). * Keeps elements in a double linked list for simpler, ordered, iteration. * Allows keeping iterators for later use in removal (Unlike Map<>, it does not do much for performance vs keeping the key, but helps replace old code). * Uses a more modern C++ iterator API, deprecates the old one. * Supports custom allocator (in case there is a wish to use a paged one). This class aims to unify all the associative template usage and replace it by this one: * Map<> (whereas key order does not matter, which is 99% of cases) * HashMap<> * OrderedHashMap<> * OAHashMap<>
* Remove `TTRC()` with empty stringHaoyu Qiu2022-03-021-1/+1
| | | | Fixes "duplicate message definition" when extracting messages.
* Fix action exact matchNathan Franke2022-01-241-28/+14
|
* Update copyright statements to 2022Rémi Verschelde2022-01-031-2/+2
| | | | Happy new year to the wonderful Godot community!
* Replace String comparisons with "", String() to is_empty()Nathan Franke2021-12-091-3/+3
| | | | | | Also: - Adds two stress tests to test_string.h - Changes to .empty() on std::strings
* Use "enum class" for input enumsAaron Franke2021-11-121-86/+86
|
* Replace auto completion shortcut for macfabriceci2021-09-281-1/+1
|
* Improve implementation of builtin action overridesEric M2021-09-211-15/+39
|
* InputMap: Fixup `macos` feature tag overrides after #52291Rémi Verschelde2021-09-151-5/+5
| | | | Fixes #52691.
* Rename `osx` to `macos` in input map feature tag handlingHugo Locurcio2021-09-151-26/+26
| | | | This follows the general feature tag rename for 4.0.
* Merge pull request #50375 from Paulb23/code_edit_unit_testsRémi Verschelde2021-09-131-0/+4
|\
| * Fix InputMap and display server not nulling singleton on freePaulb232021-09-011-0/+4
| |
* | Make platform feature tag names lowercaseHugo Locurcio2021-08-311-31/+31
|/ | | | | | | | | | | | | | Feature tag names are still case-sensitive, but this makes built-in feature tags more consistent. - `Windows` -> `windows` - `OSX` -> `osx` - `LinuxBSD` -> `linuxbsd` - `Android` -> `android` - `iOS` -> `ios` - `HTML5` -> `html5` - `JavaScript` -> `javascript` - `UWP` -> `uwp`
* Adding InputMap action error suggestion for Input singletonjmb4622021-08-161-9/+9
|
* Fix input methods returning zero strength when pressed status not requestedMai Lavelle2021-08-161-2/+3
| | | | | | | | | | | | | 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 afa89c9eea5c99
* Fix action_get_events returning booleans instead of InputKey entriesJulien Nguyen2021-08-071-1/+1
|
* Use const references where possible for List range iteratorsRémi Verschelde2021-07-251-2/+2
|
* Use C++ iterators for Lists in many situationsAaron Franke2021-07-231-14/+10
|
* Add `get_dead_zone()` method to `InputMap`Nick H2021-07-021-0/+1
| | | | This commit adds a new method to the `InputMap`, allowing the user to get the value of an action's dead zone as a float.
* Merge pull request #48696 from madmiraal/fix-48692Rémi Verschelde2021-06-201-4/+1
|\ | | | | Fix `InputMap.action_erase_event()` failing to erase events correctly.
| * Fix InputMap.action_erase_event() failing to erase events correctly.Marcel Admiraal2021-05-191-4/+1
| |
* | Documentation search fixesGregory Basile2021-06-161-1/+7
| | | | | | | | | | | | 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"
* | Added Input_Map entry for backspacing using Shift+BackspaceSpaghettiCoder012021-06-151-0/+1
| |
* | Move and expose AutoComplete in CodeEditPaulb232021-06-011-1/+5
| |
* | Add a keyboard shortcut to select the word under cursor in TextEditHugo Locurcio2021-05-221-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.)
* | Fix typos with codespellRémi Verschelde2021-05-201-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using codespell 2.0.0. Method: ``` $ cat > ../godot-word-whitelist.txt << EOF ang curvelinear dof doubleclick fave findn GIRD leapyear lod merchantibility nd numer ois ony que seeked synching te uint unselect webp EOF $ codespell -w -q 3 -I ../godot-word-whitelist.txt --skip="./thirdparty,*.po" $ git diff // undo unwanted changes ```
* Add Enter as alternate key to complete codekobewi2021-05-031-0/+1
|
* Print suggestions when requesting a nonexistent InputMap actionHugo Locurcio2021-04-181-9/+38
| | | | Co-authored-by: Marc Gilleron <marc.gilleron@gmail.com>