Laptop touch screen input

Hello! I am new to Defold and I experience a problem with touch events

I created a Side Scroller Tutorial project from the templates. I tried to support mouse click and touch screen

Mouse and long slide touch works fine, my problem is with the single touch. It does not work as expected

The documentation state that single touches are automatically considered as mouse left click. But in my case it does not : it is considered as action_id = nil

But if i double tap, it is then considered as a mouse click.

Why this behaviour? I expected a single click to be considered a left mouse button click.

It might be a bug? I am using a Windows laptop with touch screen. Does anyone has experienced a similar issue or anyone that knows how to fix this?

When action_id is nil it usually indicates mouse/touch movement. The click/touch/press event will only happen during the single frame when the click starts and on the frame when the click/touch is released.

1 Like

Ok , so Defold considers my single touch as a movement? That does not sound expected, does it?

In the video I recorded the problem :

On first game launch, I touch only one time the screen. We can see that a mouse/touch movement action is logged instead of a mouse click action

Then on second game launch, I touch 2 times with my finger. We can see that some mouse click actions are logged and also some mouse/touch movement.

I looked at my touch configuration in control panel. As we can see, double click is mapped to a double lick, and the long click as a right mouse click

Is there anything I can do to help understanding the problem?

No it doesn’t sound expected. And quite frankly I’ve never seen such a thing before.

1 Like

This happened to me too and felt wrong, so I have now raised an issue:

1 Like