Advice on implementing double click

Hey everyone, I was recently asked to add a double click functionality to a client’s project and I am a bit unsure about how to implement it. It doesn’t appear that there is any specific event or library function that handles this sort of thing, I believe that I can do it manually but I thought that I would ask about people’s experience with this sort of thing. Is it enough to just add a function to the “mousePressed” event where if the mouse was pressed and released once before within the last second or so it registers a double click? Will I need to add code to do debouncing or is that generally handled by the mouse itself?

Thank you!

In the web world, I would use rxjs for these things, e.g. https://codepen.io/hatelove85911/pen/RRRxwz. You could probably do that with rxcpp or ofxRx. But maybe that’s a bit of an overkill if you just need a double click. Maybe ofxPointer can be helpful.