Grab and Touch
Monkey Forums/Monkey Programming/Grab and Touch
| ||
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? |
| ||
Thinking purely theoretically, without any consideration for code but. If icon pressed for less than X frames / milliseconds Then consider icon tapped |
| ||
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. |
| ||
what raz/coppercircle said but you can also automatically switch to drag mode (overriding touch timeouts) if the touch position moves a certain amount. |
| ||
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. |
| ||
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. |