summaryrefslogtreecommitdiffstats
path: root/core/input
Commit message (Collapse)AuthorAgeFilesLines
* Fix gamepad triggers not working on web exportsLisandro Lorea2024-09-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes #81758 DisplayServerWeb::process_joypads handles buttons 6 and 7 of the HTML5 Standard Gamepad as a special case by doing: `input->joy_axis(idx, (JoyAxis)b, s_btns[b]);` This doesn't work because there is no JoyAxis 6 or 7 in the enum To fix this we use JoyAxis::TRIGGER_LEFT and TRIGGER_RIGHT for button 6 and 7 However since we are now lying to input->joy_axis we also need to lie in the mappings for the standard gamepad in godotcontrollersdb.txt, otherwise input->joy_axis will try to find a mapping to axis 4(LT) and axis 5(RT) that's not defined. Therefore we set lefttrigger to +a4 and righttrigger to +a5 in the mapping, to match what we are actually sending. A cleaner, and more involved fix to this would be modifying input->joy_button so that it can handle analog buttons and map them to axes preserving their value instead of converting to boolean (cherry picked from commit 9dd372f3164f3daf01c02d1f4ba304ffde47f394)
* Merge pull request #94413 from rburing/fix_action_press_tickRémi Verschelde2024-07-171-2/+4
|\ | | | | | | Fix physics tick count in `Input.action_press` and `Input.action_release`
| * Fix physics tick count in Input.action_press and Input.action_releaseRicardo Buring2024-07-161-2/+4
| | | | | | | | The physics tick count was not yet updated there.
* | Merge pull request #94052 from m4gr3d/clean_input_dispatch_settingsRémi Verschelde2024-07-172-8/+8
|\ \ | |/ |/| | | Cleanup Android input on render thread settings
| * Cleanup Android input on render thread settingsFredia Huya-Kouadio2024-07-092-8/+8
| | | | | | | | | | | | | | Follow up to https://github.com/godotengine/godot/pull/93933 Clean up the set of settings use to control whether Android input should be dispatched on the render thread. Addresses comments in https://github.com/godotengine/godot/pull/93933#issuecomment-2210437977
* | Add Home/End to text caret movements on macOSMikael Hermansson2024-07-081-0/+4
| |
* | Fix physics tick counterRicardo Buring2024-07-071-2/+3
|/ | | | | | The counter is now incremented at the start of a physics tick rather than at the end. Co-authored-by: lawnjelly <lawnjelly@gmail.com>
* Fix Steam input "crc" errors, and some other Coverity reports of ↵Rémi Verschelde2024-05-311-0/+1
| | | | | | | uninitialized scalar variable - Fixes #88630. - Fixes #92578.
* Merge pull request #92201 from bruvzg/input_flushRémi Verschelde2024-05-302-0/+11
|\ | | | | | | Clean `Input::frame_parsed_events` before de-initialising scripting languages to ensure no script created events exist at the exit.
| * Clean Input::frame_parsed_events before de-initialising scripting languages ↵bruvzg2024-05-302-0/+11
| | | | | | | | to ensure no script created events exist at the exit.
* | Add event_index to InputEventActionkobewi2024-05-304-1/+24
|/
* Update pre-commit hooks configuration to use `ruff` instead of `black`Jakub Marcowski2024-05-211-1/+0
|
* Merge pull request #88343 from Riteo/warped-mouse-floatRémi Verschelde2024-05-062-7/+7
|\ | | | | | | Handle warped mouse motion as floating point
| * Handle warped mouse motion as floating pointRiteo2024-02-142-7/+7
| | | | | | | | | | | | | | | | | | Fixes certain issues where sub-pixel motions would get discarded while the mouse is captured, such as when free look is enabled in the editor (at least when turned on while holding right click). Very slightly compat breaking, as actual public APIs are changed, although with "compatible" types (Point2i->Point2).
* | Implement `amplitude` to Input.vibrate_handheldRadiant2024-05-023-4/+51
| | | | | | | | | | Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> Co-authored-by: m4gr3d <m4gr3d@users.noreply.github.com>
* | Sync controller mappings DB with SDL 2 community repoRémi Verschelde2024-04-241-0/+4
| | | | | | | | Synced with mdqinc/SDL_GameControllerDB@5b4efa3a2015552cec4cb809169d29615202e9f2
* | Sync controller mappings DB with SDL 2 community repoRémi Verschelde2024-04-081-20/+55
| | | | | | | | Synced with mdqinc/SDL_GameControllerDB@4c9b8dace8378e22474556e0259d02b59ea55484
* | Fix action_press() by clamping strength to 0, 1Mark Wilson2024-03-271-1/+1
| | | | | | | | | | | | | | Changed Input.action_press() treatment of strength parameter to match behavior of InputEventAction and documentation, by clamping between 0 and 1. Fixes Input.get_action_strength() returning values over 1 when large values are passed to Input.action_press().
* | Merge pull request #87883 from TontonSancho/text-skip-occurenceRémi Verschelde2024-03-251-0/+5
|\ \ | | | | | | | | | Add 'Skip to next (text) occurrence' feature to text editor
| * | 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.
* | | [Buildsystem] Fix encoding when reading filesA Thousand Ships2024-03-241-1/+1
|/ /
* | Expose `DEVICE_ID_EMULATION` constant in InputEventHugo Locurcio2024-03-161-0/+2
| | | | | | | | This also improves the documentation related to emulated InputEvents.
* | SCons: Remove `run_in_subprocess` dependencyThaddeus Crews2024-03-111-11/+3
| |
* | SCons: Ensure `with` statement where applicableThaddeus Crews2024-03-101-48/+46
| |
* | Enforce `\n` eol for Python writesThaddeus Crews2024-03-091-1/+1
| | | | | | | | • Ensure utf-8 encoding if previously unspecified
* | Add two new COMSTR environment variablesThaddeus Crews2024-03-011-1/+1
| |
* | Add autocompletion for InputMap's methodsMicky2024-03-012-0/+33
| |
* | Optimise Object's `get_argument_options`Micky2024-02-292-1/+6
| |
* | Add const lvalue ref to core/* container parametersMuller-Castro2024-02-142-14/+14
|/
* Add screen-related attributes to mouse input eventsMarkus Sauermann2024-02-054-5/+96
|
* Sync controller mappings DB with SDL2 community repoRémi Verschelde2024-01-301-10/+28
| | | | Synced with gabomdq/SDL_GameControllerDB@232c738ce0948eb86b6b1b6ba7bcdc92d10faef0
* Add InputEventKey.location to tell left from rightMel Collins2024-01-262-1/+48
| | | | | | | | | | This adds a new enum `KeyLocation` and associated property `InputEventKey.location`, which indicates the left/right location of key events which may come from one of two physical keys, eg. Shift, Ctrl. It also adds simulation of missing Shift KEYUP events for Windows. When multiple Shifts are held down at the same time, Windows natively only sends a KEYUP for the last one to be released.
* Merge pull request #87324 from jsjtxietian/action-existYuri Sizov2024-01-181-0/+4
|\ | | | | | | Check action exists in `Input.action_press` and `action_release`
| * Check action exists in `Input.action_press` and `action_release`jsjtxietian2024-01-181-0/+4
| |
* | Fix `#if *_ENABLED` inconsistencies, should check if definedRémi Verschelde2024-01-171-2/+2
|/ | | | Co-authored-by: Caroline Joy Bell <halotroop2288@proton.me>
* Merge pull request #84445 from Rubonnek/add-const-references-clang-tidyRémi Verschelde2024-01-042-3/+3
|\ | | | | | | Add const references detected by clang-tidy
| * Add const references detected by clang-tidyWilson E. Alvarez2023-12-162-3/+3
| |
* | Fix missing autocompletion for inheriting classesMicky2024-01-031-0/+1
|/
* Add bindings for setting and getting emulation mouse from touch and touch ↵CaTaTo2023-12-131-0/+6
| | | | from mouse in input
* Rework action pressed state to support multiple controllersGilles Roudière2023-12-042-102/+111
|
* Rework input actions to be reliablekobewi2023-11-104-59/+102
|
* Sync controller mappings DB with SDL2 community repoRémi Verschelde2023-10-231-1/+11
| | | | | | Synced with gabomdq/SDL_GameControllerDB@eb831f75abb5c796fb2f2843c3e055d2b8cba29b Fixes #83552.
* Merge pull request #81322 from johnnyw/android_fix_joypad_trigger_rangeRémi Verschelde2023-10-202-4/+6
|\ | | | | | | Android: Fix joypad trigger value range
| * Android: Fix joypad trigger value rangeJohn Watson2023-10-202-4/+6
| | | | | | | | | | | | `Input::joy_axis` converts trigger values to be between 0.0f to 1.0f by default. This is not needed for Android, as values are already within that range, as per Android documentation: https://developer.android.com/reference/android/view/MotionEvent#AXIS_RTRIGGER This patch prevents this conversion on Android, which caused L2 and R2 triggers to get stuck pressed. https://github.com/godotengine/godot/issues/79263
* | Fix `Input.is_action_just_pressed` flicker on joypad axesErezShahaf2023-10-161-8/+7
| | | | | | | | | | | | | | | | | | Pressed tick assignments were in the wrong scope, resulting in updating `pressed_frame` even when it shouldn't and therefore the `just_pressed` would return true every time that the strength changes and not only when there's a new valid press. Fixes #81975.
* | Merge pull request #82203 from KoBeWi/shortcuts_under_pressureRémi Verschelde2023-09-242-0/+6
|\ \ | | | | | | | | | Make InputEventShortcut always pressed
| * | Make InputEventShortcut always pressedkobewi2023-09-232-0/+6
| | |
* | | Sync controller mappings DB with SDL2 community repoRémi Verschelde2023-09-241-47/+152
|/ / | | | | | | Synced with gabomdq/SDL_GameControllerDB@fc4b33c87239865487a3d956f7540a8d420066f5
* | Merge pull request #81170 from KoBeWi/step_inputRémi Verschelde2023-09-112-5/+27
|\ \ | | | | | | | | | Prevent axis-based actions from getting stuck
| * | Prevent axis-based actions from getting stuckkobewi2023-09-042-5/+27
| |/