summaryrefslogtreecommitdiff
path: root/core/input
AgeCommit message (Collapse)Author
2021-06-03Add MOUSE_MODE_CONFINED_HIDDENAaron Franke
Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
2021-06-01Move and expose AutoComplete in CodeEditPaulb23
2021-05-22Add a keyboard shortcut to select the word under cursor in TextEditHugo Locurcio
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.)
2021-05-20Change behavior of String.rightTomasz Chabora
2021-05-20Fix typos with codespellRémi Verschelde
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 ```
2021-05-17Merge pull request #48168 from LightningAA/control-to-ctrl-4.0Rémi Verschelde
2021-05-17Fix typo in InputEventMIDI stringfox
2021-05-15Make printing of InputEvents consistentMarcel Admiraal
- Removes the undesired spaces before the colon - Adds missing commas between parameters - Adds quotes or brackets to strings - Removes brackets around single values
2021-05-07Rename "Control" key to "Ctrl" and add "_pressed" suffix to all ↵Lightning_A
InputEventWithModifiers properties/methods
2021-05-04Rename `doubleclick` to `double_click`Aaron Franke
2021-05-03Add Enter as alternate key to complete codekobewi
2021-04-27Core: Drop custom `copymem`/`zeromem` definesRémi Verschelde
We've been using standard C library functions `memcpy`/`memset` for these since 2016 with 67f65f66391327b2967a20a89c3627e1dd6e84eb. 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.
2021-04-18Merge pull request #35666 from Calinou/inputmap-nonexistent-suggestionsRémi Verschelde
Print suggestions when requesting a nonexistent InputMap action
2021-04-18Print suggestions when requesting a nonexistent InputMap actionHugo Locurcio
Co-authored-by: Marc Gilleron <marc.gilleron@gmail.com>
2021-04-17Avoid creating joy_names map entries when using Map operator[]Marcel Admiraal
2021-04-06Sync controller mappings DB with SDL2 community repoRémi Verschelde
Synced with gabomdq/SDL_GameControllerDB@01dce71403e93eb699cc156f3237725863f0105a.
2021-03-23Sync controller mappings DB with SDL2 community repoRémi Verschelde
Synced with gabomdq/SDL_GameControllerDB@807ac1fbf9352da30ecbef869eced4a5bbf3c13e.
2021-03-23Rename some more global enums (Key, Joy, MIDI)Aaron Franke
2021-03-23Rename ButtonList enum and members to MouseButtonAaron Franke
2021-03-21[HTML5] Logitech Dual Action Gamepad FF/LinuxFabio Alessandrelli
2021-03-12Fixes small typos and grammar correctionAnshul7sp1
2021-02-24Merge pull request #46371 from EricEzaM/PR/fix-osx-inputmap-spammed-errorsRémi Verschelde
Fixed 'nonexistent action' errors spammed at startup on OSX
2021-02-24Fixed 'nonexistent action' errors spammed at startup on OSXEric M
2021-02-24Input: Throw error if action doesn't existLiz Haas
Thow errors if requesting an unexisting InputMap action. Makes `Input.is_action_*` methods consistents with `Event.is_action_*` which already throw errors. fixes #33303
2021-02-22Input: Swap events for ui_redo to favor Shift+Ctrl+Z over Ctrl+YRémi Verschelde
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).
2021-02-19doc: Sync classref with current sourceRémi Verschelde
And fix various bogus bindings following previous PRs.
2021-02-18Removed hardcoded shortcuts from /scene and converted to input actionsEric M
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.
2021-02-18Added ability to override built-in actions for the editorEric M
This adds the ability to add overrides for built-in actions (i.e. ui_*) in the editor. Also added a number of additional built-in actions for various text-related actions, gui-generic actions (like copy and paste) and graph-related actions (duplicate nodes), etc. Moved the definition of input actions to input_map, rather than in project_settings so the editor can make use of these actions as well.
2021-02-18Added convenience create_reference methods for Key and JoyButton inputsEric M
2021-02-15Merge pull request #44355 from ↵Rémi Verschelde
EricEzaM/PR/fix-action-false-positives-and-allow-checking-exact-matches Allow checking for exact matches with Action events.
2021-02-08Sync controller mappings DB with SDL2 community repoRémi Verschelde
Synced with gabomdq/SDL_GameControllerDB@f72b68b8b090e689ed21f600e89db9a661edb696. Partial revert of #45790.
2021-02-08Merge pull request #45797 from madmiraal/add-new-sdl-keywordsRémi Verschelde
Add support for new SDL gamecontroller keywords.
2021-02-07Add support for new SDL gamecontroller keywords.Marcel Admiraal
2021-02-07Fix issues in last GameControllerDB syncRémi Verschelde
We don't support 'misc1' as an output string yet (seems used for PS5 controller). Yet another broken CSV line with 'CO.,LTD'.
2021-02-06Merge pull request #45756 from Faless/js/4.x_gamepads_dbRémi Verschelde
Add some HTML5 controllers mapping.
2021-02-06Add some HTML5 controllers mapping.Fabio Alessandrelli
2021-02-06Sync controller mappings DB with SDL2 community repoRémi Verschelde
Synced with gabomdq/SDL_GameControllerDB@c7cf1397c1e07182de936e72fa1bc5cc22ab8cc1.
2021-01-18[HTML5] Custom Gamepad library to allow remapping.Fabio Alessandrelli
No longer use emscripten functions for gamepads, implement them as library functions in library_godot_display.js instead. This allows us to do a better job at "guessing" vendorId, productId, OS, etc. thus allowing us to better find the remapping for the controller.
2021-01-18Better gamepad axis event injection.Fabio Alessandrelli
In the core input handling code we have checks to make sure that if axis rapidly change sign we inject mid-points to release any pending inputmap action. The function though, did not correctly insert the mid-point causing dpads mapped to an axis that behaves like tri-state buttons (-1,0,1) to not be released correctly. This commit fixes that by including in the check the case where the axis swtiches from abs(1) to 0.
2021-01-01Update copyright statements to 2021Rémi Verschelde
Happy new year to the wonderful Godot community! 2020 has been a tough year for most of us personally, but a good year for Godot development nonetheless with a huge amount of work done towards Godot 4.0 and great improvements backported to the long-lived 3.2 branch. We've had close to 400 contributors to engine code this year, authoring near 7,000 commit! (And that's only for the `master` branch and for the engine code, there's a lot more when counting docs, demos and other first-party repos.) Here's to a great year 2021 for all Godot users 🎆
2020-12-28Merge pull request #44593 from madmiraal/rename-mainloop-methodsRémi Verschelde
Rename MainLoop methods to match Node methods
2020-12-28Rename empty() to is_empty()Marcel Admiraal
2020-12-22Rename MainLoop methods to match Node methodsMarcel Admiraal
2020-12-15Allow checking for exact matches with Action events.EricEzaM
Added additional param to action related methods to test for exactness. If "p_exact_match" is true, then the action will only be "matched" if the provided input event *exactly* matches with the action event. Before: * Action Event = KEY_S * Input Event = KEY_CONTROL + KEY_S * Is Action Pressed = True Now: You can still do the above, however you can optionally check that the input is exactly what the action event is: * Action Event = KEY_S * Input Event = KEY_CONTROL + KEY_S * p_exact_match = True * Is Action Pressed = False * If the Input Event was only KEY_S, then the result would be true. Usage: ```gdscript Input.is_action_pressed(action_name: String, exact_match: bool) Input.is_action_pressed("my_action", true) InputMap.event_is_action(p_event, "my_action", true) func _input(event: InputEvent): event.is_action_pressed("my_action", false, true) # false = "allow_echo", true = "exact_match" event.is_action("my_action", true) ```
2020-12-14Fixed mistakes in InputEvent as_text and to_string implementations.EricEzaM
2020-12-03Merge pull request #43660 from EricEzaM/PR/INP1-inputevent_as_text_and_to_stringRémi Verschelde
InputEvent as_text now returns readable string. Added to_string for debug strings
2020-12-03Ignore hint entries in game controller mappingMarcel Admiraal
2020-11-27InputEvent as_text now returns readable string. Added to_string for debug ↵Eric M
strings Made InputEvent as_text() return a readable and presentable string. Added to_string() overrides for each which returns a 'debug-friendly' version which is not as presentable but provides more information and in a more structured fashion. Use as_text() for UI display scenarions and to_string() for debug cases
2020-11-19Merge pull request #43591 from madmiraal/fix-43520Rémi Verschelde
Update joy button and stick names, enums and documentation
2020-11-19Update joy button and stick names, enums and documentationMarcel Admiraal