Hi everyone,
I'm trying to implement a "long press" (tap to do one thing, press and hold to put the watch into a different mode), but I'm running into an odd problem, at least with the simulator: if I click and hold, a mouseup event occurs about 500ms after the mousedown event, even if I don't release the mouse.
Here's the code I've added to the digital clock starter project:
// Event logging.
let mouseDownTime = null;
myLabel.onmousedown = () => {
mouseDownTime = new Date();
console.log ("mousedown at " + mouseDownTime.getTime());
};
myLabel.onmouseup = () => {
let now = new Date();
console.log ("mouseup at " + now.getTime()
+ " elapsed " + (now.getTime() - mouseDownTime.getTime()))
};
A normal click and release produces the results you'd expect: