aboutsummaryrefslogtreecommitdiff
path: root/main/input_default.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* Restored black bars and custom images instead of black bars, closes #1571Juan Linietsky2017-08-071-3/+8
|
* OUYA Controller for Version 3.0 input_default.cppCorruptinator2017-07-111-0/+1
| | | | | | | OUYA Game Controller for the Godot Game Engine version 3.0, allows the controller to be implemented in the if (ANDROID) part within input_default.cpp, hopefully fixing the problem that originated from #9390 on version 2.1.4 BETA as well.
* Fix possible crash in joy_axis (fixes #4944).Marcelo Fernandez2017-06-221-0/+2
|
* renamed all Rect2.pos to Rect2.positionalexholly2017-06-041-2/+2
|
* InputEvent: Renamed "pos" property to "position"Andreas Haas2017-06-031-4/+4
| | | | Make the naming consistent with other classes.
* Fix InputEvent actions.Andreas Haas2017-05-271-1/+1
| | | | | The `InputEvent::is_action(pressed|released)` methods weren't implemented yet. Also fixed a typo in `InputDefault` that prevented `Input.is_action(pressed|released)` from working.
* Fix echo key event handling.Andreas Haas2017-05-251-1/+1
|
* Removal of InputEvent as built-in Variant type..Juan Linietsky2017-05-201-83/+75
| | | | this might cause bugs I haven't found yet..
* Fix joystick crash when mapping is -1darkoff92017-04-101-0/+1
|
* Re-add ouya gamepad mapping.Andreas Haas2017-04-101-0/+2
| | | | Also adds yet another type of ps4 controller.
* Rename [gs]et_pos to [gs]et_position for ControlsSergey Pusnei2017-04-101-5/+5
| | | | | | | | Control set_pos -> set_position Control set_global_pos -> set_global_position [gs]et_mouse_pos -> [gs]et_mouse_position [gs]et_global_mouse_pos -> [gs]et_global_mouse_position fixes #8005
* Add "Godot Engine contributors" copyright lineRémi Verschelde2017-04-081-0/+1
|
* Fix warped mouse panning on LinuxPedro J. Estébanez2017-04-031-1/+16
| | | | Fix/improve it also on certain edge cases for any platform
* Input: Update Gamepad mappings.Andreas Haas2017-04-021-12/+34
|
* Initialize hat values for mapping and revert X360 mappings.Jordan Patterson2017-03-311-2/+7
|
* Input: Remove usage of platform dependent event IDs.Andreas Haas2017-03-261-44/+41
| | | | | The ID property for InputEvents is set by `SceneTree` when sending the event down the tree. So there's no need for the platform specific code to set this value when it will later be overriden anyway...
* Merge pull request #8137 from Hinsbart/mbutton_posRémi Verschelde2017-03-241-0/+5
|\ | | | | Input: Update mouse position on mouse-button events.
| * Input: Update mouse position on mouse-button events.Andreas Haas2017-03-241-0/+5
| |
* | Implement warped mouse panning for 2D & 3D editorsPedro J. Estébanez2017-03-221-0/+11
|/ | | | | Enabled by default as in Blender, but can be disabled separately for 2D & 3D; the core functionality is in Input so this could be reused or even exposed to scripts in the future
* A Whole New World (clang-format edition)Rémi Verschelde2017-03-051-184/+163
| | | | | | | | | | | | | | | | | | | | | | | | I can show you the code Pretty, with proper whitespace Tell me, coder, now when did You last write readable code? I can open your eyes Make you see your bad indent Force you to respect the style The core devs agreed upon A whole new world A new fantastic code format A de facto standard With some sugar Enforced with clang-format A whole new world A dazzling style we all dreamed of And when we read it through It's crystal clear That now we're in a whole new world of code
* Better handling of joypad device IDs.Andreas Haas2017-02-261-0/+9
| | | | | | | Now InputDefault is responsible for giving out joypad device IDs to the platform, instead of each platform handling this itself. This makes it possible for c++ modules to add their own "custom" gamepad devices, without the risk of messing up events in case the user also has regular gamepads attached (using the OS code). For now, it's implemented for the main desktop platforms. Possible targets for future work: android, uwp, javascript
* Keyboard Input modifiers do not block actions.Fabio Alessandrelli2017-01-251-9/+6
| | | | | | | | | | This means, if you press "F" while holding "shift" and there is and action registered for "F" that action should be pressed. This commit restore this behaviour, lost when implementing is_action_just_pressed. If you want "blocking modifiers" you should code it via script. Fixes 6826
* Ability to delete, drag and drop audio buses!Juan Linietsky2017-01-231-1/+1
|
* Style: No break before list braceRémi Verschelde2017-01-161-2/+1
| | | | | | | clang-format does not handle that well *at all*. For the reference, found the relevant pieces of code with: `ag "=[ "$'\t'"]?"$'\n'"[ "$'\t'"]?{" --ignore=thirdparty`
* Merge pull request #7127 from BastiaanOlij/ios_metersRémi Verschelde2017-01-151-0/+14
|\ | | | | Core motion implementation for iPhone (Accelerometer/Gyro/Magnetometer support)
| * Added support for getting gravity vector from iOSBastiaanOlij2017-01-121-0/+14
| |