infinite-mac icon indicating copy to clipboard operation
infinite-mac copied to clipboard

Some way to more reliably simulate double-clicks on mobile

Open mihaip opened this issue 2 years ago • 3 comments

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?

mihaip avatar Mar 31 '22 22:03 mihaip

PCjs appears to have a slightly different approach, where touches drive a virtual trackpad instead (code entrypoint, blog post).

mihaip avatar Mar 26 '23 22:03 mihaip

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.

that-ben avatar Mar 29 '23 21:03 that-ben

Could also experiment with pointer events (to unify the mouse and touch code paths). Per Amit they are much simpler.

mihaip avatar Apr 08 '23 21:04 mihaip