summaryrefslogtreecommitdiff
path: root/core/input
AgeCommit message (Collapse)Author
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-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
2020-11-19Merge pull request #43662 from EricEzaM/PR/INP3-command_serialization_optionalRémi Verschelde
Made serialization of Command toggleable when saving InputEvents.
2020-11-19Made serialization of Command toggleable when saving InputEvents.Eric M
Made serialization of Command optional. If command is serialized, Control (On Win/Linux) or Meta (on Mac) are not. Example use case: You are on Windows and you set a shortcut to be Control + E. This would serialize as Command=true and Control=true. If you then run this project on Mac, you would need to press Command AND Control to activate the shortcut - which is not what is intended. Now, you can set store_command to true, and it will only serialize to Command = true (no Control serialized). On Windows, this means Control. On Mac, it means only command.
2020-11-19Merge pull request #43661 from EricEzaM/PR/INP2-rename_load_from_globalsRémi Verschelde
load_from_globals() -> load_from_project_settings()
2020-11-19load_from_globals() -> load_from_project_settings()Eric M
2020-11-16Remove empty lines around braces with the formatting scriptAaron Franke
2020-11-16Merge pull request #43233 from madmiraal/fix-42876Rémi Verschelde
Remove unneeded filter on joy_axis()
2020-11-16Merge pull request #42976 from aaronfranke/input-get-axisRémi Verschelde
Allow getting Input "axis" and "vector" values by specifying multiple actions
2020-11-12Release pressed action if event is removedTomasz Chabora
2020-11-11Allow getting Input axis/vector values by specifying multiple actionsAaron Franke
For get_vector, use raw values and handle deadzones appropriately
2020-11-11Add raw strength value for internal useAaron Franke
2020-11-07Reorganized core/ directory, it was too fatty alreadyreduz
-Removed FuncRef, since Callable makes it obsolete -Removed int_types.h as its obsolete in c++11+ -Changed color names code
2020-10-31Remove unneeded filter on joy_axis()Marcel Admiraal
2020-10-26Apply upstream gamecontrollerdb patch 391.Marcel Admiraal
Co-authored-by: SalvoB <salvob41@users.noreply.github.com>
2020-10-26Provide support for buttons and D-pads mapped to half axes, andMarcel Admiraal
fix axes mapped to buttons and D-pads.
2020-10-18Refactor MethodBind to use variadic templatesreduz
Removed make_binders and the old style generated binders.
2020-09-29Removed unnecessary keyword, fix comment styleCraig-Stoneham
The privacy here is already private
2020-09-23Check for null in InputMap::_find_eventTomasz Chabora
2020-09-10Remove unused Python imports.Marcel Admiraal
2020-09-01Fix invalid CSV in SDL2 controller mappings DBRémi Verschelde
Follow-up to a61cae14696732fca214902161f40450dec2f9cd.
2020-09-01Sync controller mappings DB with SDL2 community repoRémi Verschelde
Synced with gabomdq/SDL_GameControllerDB@d148c6ce4987e0cf58da8100c675eb5db8e43dfe.
2020-07-28SCons: Refactor running commands through buildersAndrii Doroshenko (Xrayez)
A new `env.Run` method is added which allows to control the verbosity of builders output automatically depending on whether the "verbose" option is set. It also allows to optionally run any SCons commands in a subprocess using the existing `run_in_subprocess` method, unifying the interface. `Action` objects wrap all builder functions to include a short build message associated with any action. Notably, this removes quite verbose output generated by `make_doc_header` and `make_editor_icons_action` builders.
2020-07-10Add override keywords.Marcel Admiraal
2020-06-15Renamed InputMap.get_action_list to InputMap.get_action_eventsLennard
2020-06-04Sync controller mappings DB with SDL2 community repoRémi Verschelde
Synced with gabomdq/SDL_GameControllerDB@6191f6333bd66644c6a208fabb9fd5dabf0a5d43.
2020-05-19Style: Remove unnecessary semicolons from `core`Rémi Verschelde
Semicolons are not necessary after function definitions or control flow blocks, and having some code use them makes things inconsistent (and occasionally can mess up `clang-format`'s formatting). Removing them is tedious work though, I had to do this manually (regex + manual review) as I couldn't find a tool for that. All other code folders would need to get the same treatment.
2020-05-14Style: Enforce braces around if blocks and loopsRémi Verschelde
Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
2020-05-14Style: Enforce separation line between function definitionsRémi Verschelde
I couldn't find a tool that enforces it, so I went the manual route: ``` find -name "thirdparty" -prune \ -o -name "*.cpp" -o -name "*.h" -o -name "*.m" -o -name "*.mm" \ -o -name "*.glsl" > files perl -0777 -pi -e 's/\n}\n([^#])/\n}\n\n\1/g' $(cat files) misc/scripts/fix_style.sh -c ``` This adds a newline after all `}` on the first column, unless they are followed by `#` (typically `#endif`). This leads to having lots of places with two lines between function/class definitions, but clang-format then fixes it as we enforce max one line of separation. This doesn't fix potential occurrences of function definitions which are indented (e.g. for a helper class defined in a .cpp), but it's better than nothing. Also can't be made to run easily on CI/hooks so we'll have to be careful with new code. Part of #33027.
2020-05-14Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde
Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027.
2020-05-14Port member initialization from constructor to declaration (C++11)Rémi Verschelde
Using `clang-tidy`'s `modernize-use-default-member-init` check and manual review of the changes, and some extra manual changes that `clang-tidy` failed to do. Also went manually through all of `core` to find occurrences that `clang-tidy` couldn't handle, especially all initializations done in a constructor without using initializer lists.
2020-05-13Implement half axis and inverted axis mapping.Marcel Admiraal
2020-05-13Update game controller enums.Marcel Admiraal
2020-05-13Parse SDL game controller half axis and inverted axis entries.Marcel Admiraal
2020-05-11Input: Readd 'Default Android Gamepad' magic bindingRémi Verschelde
Removed by mistake in #38292 like the Windows `__XINPUT_DEVICE__`, this magic binding is referenced directly in our code.
2020-05-07Re-add __XINPUT_DEVICE__hoontee
Required for `JoypadWindows::probe_joypads`. Partially reverts 510e83498e768ffbec8177f18a50180de828b844. Fixes #38554.
2020-05-05[Windows] Add support for the WinTab API for pen input.bruvzg