{"id":14961489,"url":"https://github.com/federico-ciuffardi/godottouchinputmanager","last_synced_at":"2025-04-04T16:16:45.501Z","repository":{"id":41113469,"uuid":"232853406","full_name":"Federico-Ciuffardi/GodotTouchInputManager","owner":"Federico-Ciuffardi","description":"Asset that improves touch input support (includes new gestures) in the Godot game engine. It also translates mouse input to touch input.","archived":false,"fork":false,"pushed_at":"2024-03-18T01:10:12.000Z","size":111,"stargazers_count":542,"open_issues_count":10,"forks_count":35,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-03-28T15:11:15.465Z","etag":null,"topics":["gdscript","gesture","gesture-recognition","gesture-recognizer","gestures","godot","godot-addon","godot-engine","godot-plugin","godot-touch-input-manager","godot3","godot4","touchscreen"],"latest_commit_sha":null,"homepage":"","language":"GDScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Federico-Ciuffardi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["federico-ciuffardi"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":["https://www.paypal.com/donate?hosted_button_id=8Y6RJVLLSABGC"]}},"created_at":"2020-01-09T16:27:42.000Z","updated_at":"2025-03-25T03:11:41.000Z","dependencies_parsed_at":"2023-01-31T20:01:43.192Z","dependency_job_id":"bc36cd10-bebf-4774-95aa-a5ae4df00b6c","html_url":"https://github.com/Federico-Ciuffardi/GodotTouchInputManager","commit_stats":{"total_commits":93,"total_committers":10,"mean_commits":9.3,"dds":0.5161290322580645,"last_synced_commit":"0aff2aef3036b47226e6cf008245900972dff8f5"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Federico-Ciuffardi%2FGodotTouchInputManager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Federico-Ciuffardi%2FGodotTouchInputManager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Federico-Ciuffardi%2FGodotTouchInputManager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Federico-Ciuffardi%2FGodotTouchInputManager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Federico-Ciuffardi","download_url":"https://codeload.github.com/Federico-Ciuffardi/GodotTouchInputManager/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247208183,"owners_count":20901570,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gdscript","gesture","gesture-recognition","gesture-recognizer","gestures","godot","godot-addon","godot-engine","godot-plugin","godot-touch-input-manager","godot3","godot4","touchscreen"],"created_at":"2024-09-24T13:25:23.109Z","updated_at":"2025-04-04T16:16:45.481Z","avatar_url":"https://github.com/Federico-Ciuffardi.png","language":"GDScript","funding_links":["https://github.com/sponsors/federico-ciuffardi","https://www.paypal.com/donate?hosted_button_id=8Y6RJVLLSABGC"],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"https://i.imgur.com/HxwBAK2.png\" align=\"right\" /\u003e\n\n# Godot Touch Input Manager\nGodot Touch Input Manager (GDTIM) is an asset that improves touch input support (includes [new gestures](#supported-gestures)) in the Godot game engine. You just need to autoload a script and it will start analyzing the touch input. When a gesture is detected a Custom Input Event corresponding to the detected gesture will be created and [fed up](https://docs.godotengine.org/en/stable/classes/class_input.html#class-input-method-parse-input-event) to the Godot built in Input Event system so it triggers functions like [`_input(InputEvent event)`](https://docs.godotengine.org/en/stable/classes/class_node.html#class-node-method-input). There is also a signal for each gesture if you prefer using signals to the aforementioned.\n\nThere are two active PRs that add some GDTIM gestures as native Godot events, one for [version 3.x](https://github.com/godotengine/godot/pull/37754) and one for [version 4.x](https://github.com/godotengine/godot/pull/39055), if you are interested, please show your support there.\n\n## Table of contents\n* [How to use](#how-to-use)\n* [Examples](#examples)\n* [Documentation](#documentation)\n* [FAQ](#faq)\n\n## How to use\n* Download the latest release from https://github.com/Federico-Ciuffardi/Godot-Touch-Input-Manager/releases\n* Extract the downloaded *.zip* file somewhere in you project\n* Locate the extracted `InputManager.gd`, and [Autoload](https://docs.godotengine.org/en/3.4/tutorials/scripting/singletons_autoload.html) it.\n* Done! Now you can use GDTIM [signals and Custom Input Events](#supported-gestures).\n\n## Examples\n### [GodotTouchInputManager-Demo](https://github.com/Federico-Ciuffardi/GodotTouchInputManager-Demo)\n![Demo](https://media.giphy.com/media/wnMStTBUdhQcnXLXpB/giphy.gif)\n### [GestureControlledCamera2D](https://github.com/Federico-Ciuffardi/GestureControlledCamera2D)\n![Demo](https://media.giphy.com/media/Xzdynnlx4XAqndgVe0/giphy.gif)\n\n## Documentation\n\n* [Supported gestures](#supported-gestures)\n* [Gesture emulation](#gesture-emulation)\n* [Configuration](#configuration)\n\n### Supported gestures \n\n| Gesture name               | Signal            | Custom input event / Signal arg                                                                                                       | Description                                  |\n|----------------------------|-------------------|---------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------|\n| Single finger touch        | single_touch      | [InputEventSingleScreenTouch](https://github.com/Federico-Ciuffardi/Godot-Touch-Input-Manager/wiki/InputEventSingleScreenTouch)       | Touch with a single finger                   |\n| Single finger tap          | single_tap        | [InputEventSingleScreenTap](https://github.com/Federico-Ciuffardi/Godot-Touch-Input-Manager/wiki/InputEventSingleScreenTap)           | Fast press and release with a single finger  |\n| Single finger long press   | single_long_press | [InputEventSingleScreenLongPress](https://github.com/Federico-Ciuffardi/Godot-Touch-Input-Manager/wiki/InputEventSingleScreenLongPress)   | Press and hold with a single finger          |\n| Single finger drag         | single_drag       | [InputEventSingleScreenDrag](https://github.com/Federico-Ciuffardi/Godot-Touch-Input-Manager/wiki/InputEventSingleScreenDrag)         | Drag with a single finger                    |\n| Single finger swipe        | single_swipe      | [InputEventSingleScreenSwipe](https://github.com/Federico-Ciuffardi/Godot-Touch-Input-Manager/wiki/InputEventSingleScreenSwipe)       | Fast drag and release with a single finger   |\n| Multiple finger tap        | multi_tap         | [InputEventMultiScreenTap](https://github.com/Federico-Ciuffardi/Godot-Touch-Input-Manager/wiki/InputEventMultiScreenTap)             | Fast press and release with multiple fingers |\n| Multiple finger long press | multi_long_press  | [InputEventMultiScreenLongPress](https://github.com/Federico-Ciuffardi/Godot-Touch-Input-Manager/wiki/InputEventMultiScreenLongPress) | Press and hold with multiple fingers         |\n| Multiple finger drag       | multi_drag        | [InputEventMultiScreenDrag](https://github.com/Federico-Ciuffardi/Godot-Touch-Input-Manager/wiki/InputEventMultiScreenDrag)           | Drag with multiple fingers (same direction)  |\n| Multiple finger swipe      | multi_swipe       | [InputEventMultiScreenTap](https://github.com/Federico-Ciuffardi/Godot-Touch-Input-Manager/wiki/InputEventMultiScreenTap)             | Fast drag and release with multiple fingers  |\n| Pinch                      | pinch             | [InputEventScreenPinch](https://github.com/Federico-Ciuffardi/Godot-Touch-Input-Manager/wiki/InputEventScreenPinch)                   | Drag with multiple fingers (inward/outward)  |\n| Twist                      | twist             | [InputEventScreenTwist](https://github.com/Federico-Ciuffardi/Godot-Touch-Input-Manager/wiki/InputEventScreenTwist)                   | Drag with multiple fingers (rotate)          |\n| Raw gesture              | raw_gesture       | [RawGesture](https://github.com/Federico-Ciuffardi/Godot-Touch-Input-Manager/wiki/RawGesture)                                   | Raw gesture state\n\nWhen one of these gestures is detected a Custom Input Event corresponding to the detected gesture will be created and [fed up](https://docs.godotengine.org/en/stable/classes/class_input.html#class-input-method-parse-input-event) to the Godot built in Input Event system so it triggers functions like [`_input(InputEvent event)`](https://docs.godotengine.org/en/stable/classes/class_node.html#class-node-method-input).\n\n### Gesture emulation\n\nThe gestures can be triggered by named [input actions](https://docs.godotengine.org/en/stable/tutorials/inputs/input_examples.html#inputmap) with specific names. If the input\naction does not exists there is a default event that will trigger the gesture.\n\nThe following table shows the default event and the names of the input actions\nthat will trigger each of the gestures that can be emulated.\n\n| Gesture name                       | Input action name       | Default event |\n|------------------------------------|-------------------------|---------------|\n| Single touch                       | single_touch            | **\\***        |\n| Multiple touch (2 fingers)         | multi_touch             | Middle click  |\n| Pinch (outward)                    | pinch_outward           | Scroll up     |\n| Pinch (inward)                     | pinch_inward            | Scroll down   |\n| Twist                              | twist                   | Right click   |\n| Single finger swipe (up)           | single_swipe_up         | w             |\n| Single finger swipe (up-right)     | single_swipe_up_right   | e             |\n| Single finger swipe (right)        | single_swipe_right      | d             |\n| Single finger swipe (down-right)   | single_swipe_down_right | c             |\n| Single finger swipe (down)         | single_swipe_down       | x             |\n| Single finger swipe (down-left)    | single_swipe_down_left  | z             |\n| Single finger swipe (left)         | single_swipe_left       | a             |\n| Single finger swipe (left-up)      | single_swipe_up_left    | q             |\n| Multiple finger swipe (up)         | multi_swipe_up          | i             |\n| Multiple finger swipe (up-right)   | multi_swipe_up_right    | o             |\n| Multiple finger swipe (right)      | multi_swipe_right       | l             |\n| Multiple finger swipe (down-right) | multi_swipe_down_right  | .             |\n| Multiple finger swipe (down)       | multi_swipe_down        | ,             |\n| Multiple finger swipe (down-left)  | multi_swipe_down_left   | m             |\n| Multiple finger swipe (left)       | multi_swipe_left        | j             |\n| Multiple finger swipe (left-up)    | multi_swipe_up_left     | u             |\n\n**\\*** There are two options to enable single finger gestures:\n1. Go to **Project \u003e Project Settings \u003e General \u003e Input Devices \u003e Pointing**\n   and turn on *Emulate Touch From Mouse* to emulate a single finger touch with\n   the left click. \n2. Go to **Project \u003e Project Settings \u003e General \u003e Input Devices \u003e Pointing**\n   and turn off both *Emulate Touch From Mouse* and *Emulate Mouse From Touch*.\n   Then set an input action called `single_touch`.\n\n## Configuration\n\nThese are located in the first lines of [InputManager.gd](https://github.com/Federico-Ciuffardi/Godot-Touch-Input-Manager/blob/master/InputManager.gd), to change them modify the \nvalues on the script.\n\n| Name                           | Default value | Description                                                                                                                                                                                                                                                                            |\n|--------------------------------|---------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| DEFAULT_BINDIGS                | true          | Enable or disable default events for [gesture emulation](#gesture-emulation)                                                                                                                                                                                                           |\n| DEBUG                          | false         | Enable or disable debug information                                                                                                                                                                                                                                                    |\n| DRAG_STARTUP_TIME              | 0.2           | Seconds from the first native drag event to the first [single finger drag](#gestures-supported) custom event                                                                                                                                                                           |\n| FINGER_SIZE                    | 100.0         | The distance between the fingers must be less than `fingers*FINGER_SIZE` pixels for the [multiple finger tap](#supported-gestures) and [multiple finger swipe](#supported-gestures) gestures to be recognized. Setting it to `INF` removes this restriction.                         |\n| MULTI_FINGER_RELEASE_THRESHOLD | 0.1           | All fingers must be released within `MULTI_FINGER_REALEASE_THRESHOLD` seconds before the gesture ends for the [multiple finger tap](#gestures-supported) and [multiple finger swipe](#gestures-supported) gestures to be recognized                                                  |\n| TAP_TIME_LIMIT                 | 0.2           | The time between the first press and the last release must be less than `TAP_TIME_LIMIT` seconds for the [single finger tap](#supported-gestures) and [multiple finger tap](#supported-gestures)  gestures to be recognized                                                          |\n| TAP_DISTANCE_LIMIT             | 25.0          | The centroid of the finger presses must differ less than `TAP_DISTANCE_LIMIT` pixels from the centroid of the finger releases for the [single finger tap](#supported-gestures) and [multiple finger tap](#supported-gestures)  gestures to be recognized.                            |\n| SWIPE_TIME_LIMIT               | 0.5           | The time between the first press and the last release must be less than `SWIPE_TIME_LIMIT` seconds for the [single finger swipe](#supported-gestures) and [multiple finger swipe](#supported-gestures)  gestures to be recognized.                                                   |\n| SWIPE_DISTANCE_THRESHOLD       | 200.0         | The centroid of the finger presses must differ by more than `SWIPE_DISTANCE_THRESHOLD` pixels from the centroid of the finger releases for the [single finger swipe](#supported-gestures) and [multiple finger swipe](#supported-gestures) gestures to be recognized.                |\n| LONG_PRESS_TIME_THRESHOLD      | 0.75          | The fingers must press for `LONG_PRESS_TIME_THRESHOLD` seconds for [single-finger long press](#gestures-supported) and [multi-finger long press](#gestures-supported) gestures to be recognized.                                                                                     |\n| LONG_PRESS_DISTANCE_LIMIT      | 25.0          | The centroid of the finger presses must differ less than `LONG_PRESS_DISTANCE_LIMIT` pixels from the centroid of the fingers last positions for the [single finger long press](#supported-gestures) and [multiple finger long press](#supported-gestures) gestures to be recognized. |\n\n## FAQ\n### How can I get GDTIM to work when using control nodes?\n\nBy default, the control nodes consume events and therefore GDTIM cannot analyze them. To prevent this, set `Mouse\u003eFilter` to `Ignore` on control nodes as needed.\n\n![image](https://user-images.githubusercontent.com/45585143/235382152-1c99f7eb-eed3-4f96-b1b2-ba0a899d5225.png)\n\nFor more information see the [documentation](https://docs.godotengine.org/en/stable/classes/class_control.html#enum-control-mousefilter).\n\n### GDTIM events don't trigger collisions, is there a way to fix it?\n\nCustom input events do not trigger collisions, at the moment the solution is to manually check for collisions between shapes and events. For more information and ideas on how to do this see [this issue](https://github.com/Federico-Ciuffardi/GodotTouchInputManager/issues/16).\n\n## Versioning\nUsing [SemVer](http://semver.org/) for versioning. For the versions available, see the [releases](https://github.com/Federico-Ciuffardi/Godot-Touch-Input-Manager/releases).\n\n## Authors\n* Federico Ciuffardi\n\nFeel free to append yourself here if you've made contributions.\n\n## Note\nThank you for checking out this repository, you can send all your questions and comments to Federico.Ciuffardi@outlook.com.\n\nIf you are willing to contribute in any way, please contact me.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffederico-ciuffardi%2Fgodottouchinputmanager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffederico-ciuffardi%2Fgodottouchinputmanager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffederico-ciuffardi%2Fgodottouchinputmanager/lists"}