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
;)
[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> |