Skip to content

Instantly share code, notes, and snippets.

@FokkeZB
Created May 27, 2013 19:19
Show Gist options
  • Save FokkeZB/5658656 to your computer and use it in GitHub Desktop.
Save FokkeZB/5658656 to your computer and use it in GitHub Desktop.
Best event for repetitive taps
[INFO] [iphone, 6.1.3, 192.168.0.103] touchstart
[INFO] [iphone, 6.1.3, 192.168.0.103] singletap
[INFO] [iphone, 6.1.3, 192.168.0.103] touchend
[INFO] [iphone, 6.1.3, 192.168.0.103] touchstart
[INFO] [iphone, 6.1.3, 192.168.0.103] singletap
[INFO] [iphone, 6.1.3, 192.168.0.103] touchend
[INFO] [iphone, 6.1.3, 192.168.0.103] touchstart
[INFO] [iphone, 6.1.3, 192.168.0.103] singletap
[INFO] [iphone, 6.1.3, 192.168.0.103] touchend
[INFO] [iphone, 6.1.3, 192.168.0.103] touchstart
[INFO] [iphone, 6.1.3, 192.168.0.103] singletap
[INFO] [iphone, 6.1.3, 192.168.0.103] touchend
function plus(e) {
Ti.API.info(e.type);
}
<Alloy>
<Window>
<Button onLongpress="plus" onLongclick="plus" onKeypressed="plus" onSingletap="plus" onClick="plus" onDblclick="plus" onTwofingertap="plus" onTouchstart="plus" onTouchmove="plus" onTouchend="plus" onTouchCancel="plus" />
</Window>
</Alloy>

Repetitive taps

I needed the right event to react on many repetitive taps. I noticed that click stops firing after some taps, so I did a little test to find the right event to listen to instead.

As the console.log shows, you need singletap ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment