summaryrefslogtreecommitdiffstats
path: root/main/input_default.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Gamepad: Parse SDL_GAMECONTROLLERCONFIG env after default mappingsRémi Verschelde2020-01-081-7/+9
| | | | Addresses comment https://github.com/godotengine/godot/issues/21918#issuecomment-458764923.
* Update copyright statements to 2020Rémi Verschelde2020-01-011-2/+2
| | | | | | | | | | | Happy new year to the wonderful Godot community! We're starting a new decade with a well-established, non-profit, free and open source game engine, and tons of further improvements in the pipeline from hundreds of contributors. Godot will keep getting better, and we're looking forward to all the games that the community will keep developing and releasing with it.
* Support vibration for Android and iOSvolzhs2019-08-211-0/+4
|
* Fix set_default_cursor_shape always sending motion eventGuilherme Felipe2019-07-291-0/+4
|
* Don't release action if it's not pressedTomasz Chabora2019-07-241-1/+2
|
* Fixes minor issues found by static analyzerqarmin2019-07-071-1/+1
|
* Some code changed with Clang-Tidyqarmin2019-06-261-21/+19
|
* [Input] Release keys/actions pressed if window loses focusGuilherme Felipe2019-04-271-0/+13
| | | | | Co-authored-by: bruvzg <7645683+bruvzg@users.noreply.github.com> Co-authored-by: Marcelo Fernandez <marcelofg55@gmail.com>
* Add Input::get_current_cursor_shapeGuilherme Felipe2019-04-151-16/+7
| | | | [Clean up] Removed unused/unnecessary methods.
* Fix fake null-motion mouse event floodPedro J. Estébanez2019-03-091-3/+3
| | | | | | This commit also improves a bit the code quality by making the intent of fake events (and themselves) more explicit. Fixes #26460.
* Improve/fix pickingPedro J. Estébanez2019-03-051-0/+3
| | | | | | | | | Acknowledge mouse button events as position tellers (to make picking more solid; for instance, the touch mouse is raised with a mouse unpressed event that may have a more current position) Forget mouse position for physics if touch mouse raised (because the position known as last is no longer meaningful) Remove needless check for mouse over/exit (now there's code to inject an spurious move for cases where camera/objects have moved) Restrict 2D mouse over/exit to mouse events (including emulated from touch; true touches shouldn't trigger the signals) Fixes #26460.
* Use accumulated input by default, fixes #26395Juan Linietsky2019-03-051-1/+1
|
* Add support for event accumlation (off by default, on for editor), fixes #26536Juan Linietsky2019-03-031-0/+27
|
* Fixed out of bounds axis name accessWilson E. Alvarez2019-01-041-3/+5
|
* Update copyright statements to 2019Rémi Verschelde2019-01-011-2/+2
| | | | Happy new year to the wonderful Godot community!
* Merge pull request #20081 from moiman100/fix-double-click-holdRémi Verschelde2018-12-141-1/+1
|\ | | | | Fixes is_pressed when holding double click.
| * Fixes is_pressed when holding double click.unknown2018-08-021-1/+1
| |
* | Allow to specify a custom strength when calling Input.action_press(), this ↵Davide Baldo2018-11-101-2/+2
| | | | | | | | allows virtual axis, mainly for mobile.
* | fixed uninitialized variables and false positives found by CppCheckSimon Wenner2018-10-251-0/+3
| |
* | Track screen drag speedPedro J. Estébanez2018-10-141-5/+30
| | | | | | | | | | | | | | | | Following the universal input handling effort, this works the same for every platform, as long as the touch move event coming from it contains the relative movement. The same tracking algorithm used to track the mouse speed is used here, but tracking separately each touch index. Fixes #3623.
* | Fix warnings for operator precedence disambiguation [-Wparentheses]Rémi Verschelde2018-09-271-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes the following GCC 5 warnings: ``` core/io/resource_format_binary.cpp:1721:29: warning: suggest parentheses around arithmetic in operand of '|' [-Wparentheses] core/typedefs.h:108:24: warning: suggest parentheses around comparison in operand of '!=' [-Wparentheses] editor/plugins/spatial_editor_plugin.cpp:2202:58: warning: suggest parentheses around comparison in operand of '!=' [-Wparentheses] editor/plugins/spatial_editor_plugin.cpp:5002:12: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses] main/input_default.cpp:346:59: warning: suggest parentheses around '-' inside '<<' [-Wparentheses] main/input_default.cpp:348:60: warning: suggest parentheses around '-' inside '<<' [-Wparentheses] main/input_default.cpp:579:57: warning: suggest parentheses around '-' inside '<<' [-Wparentheses] modules/gridmap/grid_map_editor_plugin.cpp:613:14: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses] modules/theora/video_stream_theora.cpp:335:34: warning: suggest parentheses around '+' in operand of '&' [-Wparentheses] modules/theora/video_stream_theora.cpp:336:35: warning: suggest parentheses around '+' in operand of '&' [-Wparentheses] modules/visual_script/visual_script_property_selector.cpp:215:38: warning: suggest parentheses around '&&' within '||' [-Wparentheses] scene/gui/rich_text_label.cpp:424:84: warning: suggest parentheses around '&&' within '||' [-Wparentheses] scene/gui/rich_text_label.cpp:512:80: warning: suggest parentheses around '&&' within '||' [-Wparentheses] scene/gui/scroll_container.cpp:173:36: warning: suggest parentheses around '&&' within '||' [-Wparentheses] scene/gui/scroll_container.cpp:173:86: warning: suggest parentheses around '&&' within '||' [-Wparentheses] scene/gui/tree.cpp:1419:98: warning: suggest parentheses around '&&' within '||' [-Wparentheses] ```
* | Fix warnings on non-static data member initializers (C++11 feature)Rémi Verschelde2018-09-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We're not formally using C++11 yet so those trigger compilation warnings (at least with GCC 5): ./main/input_default.h:122:30: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 CursorShape default_shape = CURSOR_ARROW; ^ Note: We may allow those eventually (especially for non-int static const), but most of current occurrences were inconsistent with all other classes. See also http://www.stroustrup.com/C++11FAQ.html#member-init
* | Fix set_default_cursor_shape interaction with Control nodesMartin Capitanio2018-09-151-1/+7
| | | | | | | | | | | | Do not call `set_cursor_shape` when the cursor is inside the `Control` node. Make it work for x11 in MOUSE_MODE_CONFINED.
* | Make core/ includes absolute, remove subfolders from include pathRémi Verschelde2018-09-121-3/+3
| | | | | | | | | | | | This allows more consistency in the manner we include core headers, where previously there would be a mix of absolute, relative and include path-dependent includes.
* | Make some debug prints verbose-only, remove othersRémi Verschelde2018-08-241-3/+0
|/
* Reduce unnecessary COW on Vector by make writing explicitHein-Pieter van Braam2018-07-261-3/+3
| | | | | | | | | | | | | | | | | | | | | | | This commit makes operator[] on Vector const and adds a write proxy to it. From now on writes to Vectors need to happen through the .write proxy. So for instance: Vector<int> vec; vec.push_back(10); std::cout << vec[0] << std::endl; vec.write[0] = 20; Failing to use the .write proxy will cause a compilation error. In addition COWable datatypes can now embed a CowData pointer to their data. This means that String, CharString, and VMap no longer use or derive from Vector. _ALWAYS_INLINE_ and _FORCE_INLINE_ are now equivalent for debug and non-debug builds. This is a lot faster for Vector in the editor and while running tests. The reason why this difference used to exist is because force-inlined methods used to give a bad debugging experience. After extensive testing with modern compilers this is no longer the case.
* Merge pull request #17196 from RandomShaper/improve-gui-touchRémi Verschelde2018-05-021-12/+106
|\ | | | | Implement universal translation of touch to mouse (3.1)
| * Implement universal translation of touch to mousePedro J. Estébanez2018-04-301-12/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now generating mouse events from touch is optional (on by default) and it's performed by `InputDefault` instead of having each OS abstraction doing it. (*) The translation algorithm waits for a touch index to be pressed and tracks it translating its events to mouse events until it is raised, while ignoring other pointers. Furthermore, to avoid an stuck "touch mouse", since not all platforms may report touches raised when the window is unfocused, it checks if touches are still down by the time it's focused again and if so it resets the state of the emulated mouse. *: In the case of Windows, since it already provides touch-to-mouse translation by itself, "echo" mouse events are filtered out to have it working like the rest. On X11 a little hack has been needed to avoid a case of a spurious mouse motion event that is generated during touch interaction. Plus: Improve/fix tracking of current mouse position. ** Summary of changes to settings: ** - `display/window/handheld/emulate_touchscreen` becomes `input/pointing_devices/emulate_touch_from_mouse` - New setting: `input/pointing_devices/emulate_mouse_from_touch`
* | Fix Coverity reports of uninitialized scalar variableRémi Verschelde2018-04-191-3/+1
| | | | | | | | | | | | | | | | | | | | | | Fixes most current reports on Coverity Scan of uninitialized scalar variable (CWE-457): https://cwe.mitre.org/data/definitions/457.html These happen most of the time (in our code) when instanciating structs without a constructor (or with an incomplete one), and later returning the instance. This is sometimes intended though, as some parameters are only used in some situations and should not be double-initialized for performance reasons (e.g. `constant` in ShaderLanguage::Token).
* | Merge pull request #16902 from groud/analog_action_systemJuan Linietsky2018-04-181-4/+14
|\ \ | |/ |/| Allow actions to provide an analog value
| * Allow actions to provide an analog valueGilles Roudiere2018-04-161-4/+14
| |
* | Implement Input.set_default_cursor_shape to change the default shapeGuilherme Felipe2018-04-101-0/+9
| | | | | | | | Closes #18043
* | Allow set_custom_mouse_cursor use same cursor(image) with different shapes.Guilherme Felipe2018-04-091-9/+0
|/
* Generate controller mapping class from one or more SDL2 database filesCarter Anderson2018-03-051-288/+7
|
* Fix typos with codespellluz.paz2018-02-211-1/+1
| | | | | | | | | | | | | | Found via `codespell -q 3 --skip="./thirdparty,./editor/translations" -I ../godot-word-whitelist.txt` Whitelist consists of: ``` ang doubleclick lod nd que te unselect ```
* Add Xbox One Elite and Xbox 360 Afterglow padsBrandon DeRosier2018-02-131-0/+2
|
* Add missing copyright headers and fix formattingRémi Verschelde2018-01-051-0/+1
| | | | | | Using `misc/scripts/fix_headers.py` on all Godot files. Some missing header guards were added, and the header inclusion order was fixed in the Bullet module.
* Merge pull request #12814 from guilhermefelipecgs/add_hardware_custom_cursorRémi Verschelde2018-01-031-15/+5
|\ | | | | Custom hardware-accelerated mouse cursor
| * Add implementation for custom hardware cursorGuilherme Silva2017-12-171-15/+5
| |
* | Update copyright statements to 2018Rémi Verschelde2018-01-011-2/+2
|/ | | | Happy new year to the wonderful Godot community!
* Updated input_default.cpp again (new maps take priority)Andrew Silver2017-12-141-12/+12
| | | | Fixes #14639
* Updated controller mappings for windows/mac/linuxAndrew Silver2017-12-101-8/+73
|
* Native pan and zoom for macOSBernhard Liebl2017-11-211-0/+9
|
* Renamed fixed_process to physics_processAndreaCatania2017-09-301-7/+7
|
* Rename pos to position in user facing methods and variablesletheed2017-09-201-3/+3
| | | | | | | | | | | Rename user facing methods and variables as well as the corresponding C++ methods according to the folloming changes: * pos -> position * rot -> rotation * loc -> location C++ variables are left as is.
* Fixed to InputDefault, button mask was wrong. Fixes to editor camera ↵Juan Linietsky2017-09-161-5/+6
| | | | interpolation.
* Dead code tells no talesRémi Verschelde2017-08-271-52/+1
|
* Use HTTPS URL for Godot's website in the headersRémi Verschelde2017-08-271-1/+1
|
* Fixed OUYA Game Controller for 3.0Corruptinator2017-08-161-1/+1
| | | | | Input_default.cpp has been updated for the OUYA Game Controller to work with fixed and functional mapping for Godot 3.0
* InputDefault: Fix joypad actions when axis quickly changes direction.Andreas Haas2017-08-121-2/+8
| | | | The fix (inserting a fake event so actions get released properly) was already there but disregarded the case when the hardware sends values in the [0;1] range.