03-26-2018 11:51
03-26-2018 11:51
How do you listen a doubleclick or doubletap ?
I know I can use single click:
myRect.onclick = function(e) { console.log("click"); }
But how to achieve doubleclick listening?
I tried:
myRect.ondblclick = function(e) { console.log("double click"); }
but with no success.
03-26-2018 12:48
03-26-2018 12:48
I don't think the API directly supports this. I've managed to fudge it by setting a JS timer when a click is detected. If a second click occurs before the timer expires, I call it a double-click. If not, I call it a single click. Aside from being a bit cumbersome to code, this also slightly reduces the responsiveness of single clicks, but if you need double-clicks, ...
Another thing you can consider if you need extra user input is simultaneous (or nearly so) clicks of both RHS buttons.