Bangle.js2 emulator: implement touchscreen long-touch gesture#311
Bangle.js2 emulator: implement touchscreen long-touch gesture#311mdoggydog wants to merge 1 commit intoespruino:masterfrom
Conversation
This change incorporates the MIT-licensed "long-press-event" library from https://github.com/john-doherty/long-press-event, and uses its default delay of 1.5 seconds.
|
Thanks! Is it possible to just implement this with a Doing it ourselves would also allow us to respond to the length of the button press - do your 'long-press' code for a medium press, and trigger a reload for a longer press (like the real watch) |
When I poked around looking for approaches to detecting long-presses, the impression I got was that (a) yes, you pretty much use
Keep in mind that this is for the touchscreen emulation, not BTN1, and there is (AFAIK) only one kind of long-press emitted by the touchscreen. But, if you mean using this browser-side long-press detection to also do something about the BTN1 events... maybe there is some relatively simple way to get multiple, different-duration events from this code?... haven't thought about that yet... |
This change incorporates the MIT-licensed "long-press-event" library from https://github.com/john-doherty/long-press-event, and uses its default delay of 1.5 seconds.
(1.5 seconds seemed about right, but I did not try to time it accurately. If anyone knows the actual delay used by the hardware device, I can adjust the delay accordingly.)