infinite-mac
infinite-mac copied to clipboard
Some way to more reliably simulate double-clicks on mobile
Can we detect double-clicks ourselves (with more tolerance) and tweak the coordinates that we sent to BasiliskII to snap them to the previous ones?
PCjs appears to have a slightly different approach, where touches drive a virtual trackpad instead (code entrypoint, blog post).
It's honestly not that bad already, but it's true that if you have a shaky finger, then it's easy to not precisely tap twice on the same exact spot, which Mac OS will then not detect as a double click but rather just 2 separate clicks or even a very brief drag operation. Perhaps make some sort of timer where if 2 taps were done in less than 0.1 second and if the coordinates are less than 5% apart, then snap the second tap coords to the first tap ones, which will result in a double click in Mac OS.
Could also experiment with pointer events (to unify the mouse and touch code paths). Per Amit they are much simpler.