Grab and Touch

Monkey Forums/Monkey Programming/Grab and Touch

Paul - Taiphoz(Posted 2012) [#1]
Anyone any ideas on how to tell the difference between a touch and a down ?

At the moment I am working on allowing the user to click/touch and drag a set of icons up or down to bring more into view, this drag works well, the problem arises when I had the tap code, I need to be able to tap on one of these icons that I am dragging around, with my tap code in, it gets triggered as soon as I drag.

I need to be able to separate a drag and a click thoughts?


Raz(Posted 2012) [#2]
Thinking purely theoretically, without any consideration for code but.

If icon pressed for less than X frames / milliseconds Then consider icon tapped


CopperCircle(Posted 2012) [#3]
If I want drag and touch I just check the time from the first touch and then check if the touch release is within a certain time for a tap, if not it's stays as a drag.


Skn3(Posted 2012) [#4]
what raz/coppercircle said but you can also automatically switch to drag mode (overriding touch timeouts) if the touch position moves a certain amount.


Tibit(Posted 2012) [#5]
Most Touch interfaces activate OnRelease, not OnPress. If after OnPress the position changes then it is a Drag. OnRelease you check if it was a drag or not. If not then it was a click.


Paul - Taiphoz(Posted 2012) [#6]
Thanks for the tips guys, the timing solution is what I was actually doing , but just could not get it to work the way I wanted, so rather than wasting time on it I switched tac and came up with a more intuitive solution , which is easier on the user and also looks slicker.

So going with the new system.