07-11-2023 06:12
07-11-2023 06:12
What's the best way to detect multiple taps?
Author | ch, passion for improvement.
Answered! Go to the Best Answer.
07-11-2023 06:15
07-11-2023 06:15
@francogrex - here is a sample tap detection
tapR.onclick = function() {
baseCount++;
// after 400 ms see how many taps have occurred and react accordingly
setTimeout(function(){
if ( baseCount == 1) { // scroll up
consolelog("scrollup tap click");
}
if ( baseCount == 2) { //scroll down
consolelog("scrolldown tap click");
}
console.log("tap reset click count");
baseCount = 0;
}, 400);
}
Author | ch, passion for improvement.
07-11-2023 06:15
07-11-2023 06:15
@francogrex - here is a sample tap detection
tapR.onclick = function() {
baseCount++;
// after 400 ms see how many taps have occurred and react accordingly
setTimeout(function(){
if ( baseCount == 1) { // scroll up
consolelog("scrollup tap click");
}
if ( baseCount == 2) { //scroll down
consolelog("scrolldown tap click");
}
console.log("tap reset click count");
baseCount = 0;
}, 400);
}
Author | ch, passion for improvement.