These are chat archives for openseadragon/openseadragon

3rd
Aug 2015
Grant Echols
@gechols
Aug 03 2015 17:14 UTC
It looks like the 'canvas-click' event gets fired when the user double clicks on the canvas so we get one or more 'canvas-click' events before we get the 'canvas-double-click' event. Is this the expected behavior? If so, do you have any suggestions to help deal with the duplication of events?
Ian Gilman
@iangilman
Aug 03 2015 17:16 UTC
@gechols that sounds right. We wouldn't want to wait before giving you the first click, because then there would be a noticeable delay for regular clicks.
If double clicks are important to you, then you'll have to set a timeout after the first click to find out whether it's the start of a double click. If you get the double click event, you can cancel the timeout. Otherwise the timeout can handle it as a single click.
Either that or a range so your single clicks do something that's compatible with the double click. e.g. a double click in your computer's file browser, where the first click selects the file and the second click opens it (but it's ok that it's been selected)
Mark Salsbery
@msalsbery
Aug 03 2015 18:39 UTC
@gechols If you need an example of using a timer you can look in the updatePointersUp() function in mouse tracker.js (search for dblClickTimeThreshold)