Is it possible to create custom events (for example, triple click or swipe) in JavaScript that will trigger with certain conditions? Perhaps to listen to this custom event:
addEventListener('trplclick', handler, false);
So handler will be called only if 3 clicks were done within 600 ms, for example.