This PR improves double-click emulation so that both of the consecutive mouse (touch) events have the exact same location. On a touch device, you might otherwise accidentally direct the second click to a slightly different location, or the target operating system might not even recognise both clicks as proper double click.
Notes
I’ve slightly re-ordered the commentary, which I thought was sensible due to the increased complexity in the file.
The parameters for detecting a double-click are heuristic at best – the 500ms delay is from this article, and the 500px distance just felt okay when trying from an iPad.
I’ve tested with this on an iPad, so from my side a pure code review would suffice.
Resolves https://github.com/tiny-pilot/tinypilot/issues/1781.
This PR improves double-click emulation so that both of the consecutive mouse (touch) events have the exact same location. On a touch device, you might otherwise accidentally direct the second click to a slightly different location, or the target operating system might not even recognise both clicks as proper double click.
Notes
I’ve tested with this on an iPad, so from my side a pure code review would suffice.