+1 vote

Hey guys,
Is it possible to get a screen_drag event that will not also trigger a screen_touch event ?
I was thinking of something like this:

    if(event.type == InputEvent.SCREEN_DRAG  and not event.type == InputEvent.SCREEN_TOUCH):

but it doesn't seem to make a difference. ~thanks

in Engine by (528 points)
edited by

1 Answer

+1 vote
Best answer

A drag event happens between two touch events.
What you can do is to delay a touch action waiting for drag, if there is no drag after some frames or seconds, do something just for touch.
If on drag mode and a touch even happens, it may be a release and drag must stop.

Is more easy if you just wait for touch release, if you didn't got a drag event before release, it was a tap (this is useful if you don't have tap&hold actions).

Always check touch index too, you don't want weird multi touch response.

by (7,898 points)
selected by

yup I thought so too, I was just making sure is not something easier and obvious that I'm missing. thanks

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.