feathersui-starling icon indicating copy to clipboard operation
feathersui-starling copied to clipboard

TapToTrigger: Extra properties to make it more Tap and less Click

Open GV3 opened this issue 8 years ago • 3 comments

I'm a devoted user of the TapToTrigger, and I often find myself having to add boilerplate code to deal with the Trigger events dispatching when the user should be able to slide a finger on an item renderer, or when I leave it long using an ANE for the iOS Touch3D.

It would be great if we could pass a few extra parameters to the TapToTrigger so that it could by its own differentiate if the user is tapping instead of clicking.

This parameter would be tapDuration, tapDistance, and slop (in case the finger travelled to far on the screen before returning to the original touch point for the release)

GV3 avatar Sep 28 '16 01:09 GV3

I think that maxTapDuration and maxTapDistance are probably better names, if I understand you correctly. You're going to need to describe slop in more detail, though. It's not a term that I've ever heard, and your description gives me the vaguest of ideas of what it might be for, but not really.

joshtynjala avatar Sep 28 '16 16:09 joshtynjala

maxTapDuration, maxTapDistance sound great to me!

So, the slop is like the maxTapDistance, except that the maxTapDistance is used to define a tap calculating the distance between the touch point and the release point, while the slop is used to see if the user moves the finger too far before releasing.

Let's say I have a Tap with a relatively long or no maxTapDuration, and I have a maxTapDistance of 10px, and a slop of 20. If the user touches down and slides his finger 15px to the left and then 10px to the right before releasing, this would be marked as Tap.

Now, if I have a slop and a maxTapDistance both of 10px, the gesture above would not trigger a Tap. The reason being that the user moved out of the slop (or spill, or the name you find most appropriate :) ) before going back to the same position and releasing.

Please let me know if it now makes more sense

GV3 avatar Sep 28 '16 20:09 GV3

Okay, I understand now!

joshtynjala avatar Sep 28 '16 21:09 joshtynjala