GitPedia

GodotTouchInputManager

Asset that improves touch input support (includes new gestures) in the Godot game engine. It also translates mouse input to touch input.

From Federico-Ciuffardi·Updated June 14, 2026·View on GitHub·

Godot 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 tri... The project is written primarily in GDScript, distributed under the MIT License license, first published in 2020. Key topics include: gdscript, gesture, gesture-recognition, gesture-recognizer, gestures.

Latest release: 4.x-v2.1.24.x - v2.1.2
<img src="https://i.imgur.com/HxwBAK2.png" align="right" />

Godot Touch Input Manager

Godot Touch Input Manager (GDTIM) is an asset that improves touch input support (includes new 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 to the Godot built in Input Event system so it triggers functions like _input(InputEvent event). There is also a signal for each gesture if you prefer using signals to the aforementioned.

There are two active PRs that add some GDTIM gestures as native Godot events, one for version 3.x and one for version 4.x, if you are interested, please show your support there.

Table of contents

How to use

Examples

GodotTouchInputManager-Demo

Demo

GestureControlledCamera2D

Demo

Documentation

Supported gestures

Gesture nameSignalCustom input event / Signal argDescription
Single finger touchsingle_touchInputEventSingleScreenTouchTouch with a single finger
Single finger tapsingle_tapInputEventSingleScreenTapFast press and release with a single finger
Single finger long presssingle_long_pressInputEventSingleScreenLongPressPress and hold with a single finger
Single finger dragsingle_dragInputEventSingleScreenDragDrag with a single finger
Single finger swipesingle_swipeInputEventSingleScreenSwipeFast drag and release with a single finger
Multiple finger tapmulti_tapInputEventMultiScreenTapFast press and release with multiple fingers
Multiple finger long pressmulti_long_pressInputEventMultiScreenLongPressPress and hold with multiple fingers
Multiple finger dragmulti_dragInputEventMultiScreenDragDrag with multiple fingers (same direction)
Multiple finger swipemulti_swipeInputEventMultiScreenTapFast drag and release with multiple fingers
PinchpinchInputEventScreenPinchDrag with multiple fingers (inward/outward)
TwisttwistInputEventScreenTwistDrag with multiple fingers (rotate)
Raw gestureraw_gestureRawGestureRaw gesture state

When one of these gestures is detected a Custom Input Event corresponding to the detected gesture will be created and fed up to the Godot built in Input Event system so it triggers functions like _input(InputEvent event).

Gesture emulation

The gestures can be triggered by named input actions with specific names. If the input
action does not exists there is a default event that will trigger the gesture.

The following table shows the default event and the names of the input actions
that will trigger each of the gestures that can be emulated.

Gesture nameInput action nameDefault event
Single touchsingle_touch*
Multiple touch (2 fingers)multi_touchMiddle click
Pinch (outward)pinch_outwardScroll up
Pinch (inward)pinch_inwardScroll down
TwisttwistRight click
Single finger swipe (up)single_swipe_upw
Single finger swipe (up-right)single_swipe_up_righte
Single finger swipe (right)single_swipe_rightd
Single finger swipe (down-right)single_swipe_down_rightc
Single finger swipe (down)single_swipe_downx
Single finger swipe (down-left)single_swipe_down_leftz
Single finger swipe (left)single_swipe_lefta
Single finger swipe (left-up)single_swipe_up_leftq
Multiple finger swipe (up)multi_swipe_upi
Multiple finger swipe (up-right)multi_swipe_up_righto
Multiple finger swipe (right)multi_swipe_rightl
Multiple finger swipe (down-right)multi_swipe_down_right.
Multiple finger swipe (down)multi_swipe_down,
Multiple finger swipe (down-left)multi_swipe_down_leftm
Multiple finger swipe (left)multi_swipe_leftj
Multiple finger swipe (left-up)multi_swipe_up_leftu

* There are two options to enable single finger gestures:

  1. Go to Project > Project Settings > General > Input Devices > Pointing
    and turn on Emulate Touch From Mouse to emulate a single finger touch with
    the left click.
  2. Go to Project > Project Settings > General > Input Devices > Pointing
    and turn off both Emulate Touch From Mouse and Emulate Mouse From Touch.
    Then set an input action called single_touch.

Configuration

These are located in the first lines of InputManager.gd, to change them modify the
values on the script.

NameDefault valueDescription
DEFAULT_BINDIGStrueEnable or disable default events for gesture emulation
DEBUGfalseEnable or disable debug information
DRAG_STARTUP_TIME0.2Seconds from the first native drag event to the first single finger drag custom event
FINGER_SIZE100.0The distance between the fingers must be less than fingers*FINGER_SIZE pixels for the multiple finger tap and multiple finger swipe gestures to be recognized. Setting it to INF removes this restriction.
MULTI_FINGER_RELEASE_THRESHOLD0.1All fingers must be released within MULTI_FINGER_REALEASE_THRESHOLD seconds before the gesture ends for the multiple finger tap and multiple finger swipe gestures to be recognized
TAP_TIME_LIMIT0.2The time between the first press and the last release must be less than TAP_TIME_LIMIT seconds for the single finger tap and multiple finger tap gestures to be recognized
TAP_DISTANCE_LIMIT25.0The 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 and multiple finger tap gestures to be recognized.
SWIPE_TIME_LIMIT0.5The time between the first press and the last release must be less than SWIPE_TIME_LIMIT seconds for the single finger swipe and multiple finger swipe gestures to be recognized.
SWIPE_DISTANCE_THRESHOLD200.0The 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 and multiple finger swipe gestures to be recognized.
LONG_PRESS_TIME_THRESHOLD0.75The fingers must press for LONG_PRESS_TIME_THRESHOLD seconds for single-finger long press and multi-finger long press gestures to be recognized.
LONG_PRESS_DISTANCE_LIMIT25.0The 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 and multiple finger long press gestures to be recognized.

FAQ

How can I get GDTIM to work when using control nodes?

By default, the control nodes consume events and therefore GDTIM cannot analyze them. To prevent this, set Mouse>Filter to Ignore on control nodes as needed.

image

For more information see the documentation.

GDTIM events don't trigger collisions, is there a way to fix it?

Custom 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.

Versioning

Using SemVer for versioning. For the versions available, see the releases.

Authors

  • Federico Ciuffardi

Feel free to append yourself here if you've made contributions.

Note

Thank you for checking out this repository, you can send all your questions and comments to Federico.Ciuffardi@outlook.com.

If you are willing to contribute in any way, please contact me.

Contributors

Showing top 9 contributors by commit count.

View all contributors on GitHub →

This article is auto-generated from Federico-Ciuffardi/GodotTouchInputManager via the GitHub API.Last fetched: 6/22/2026