Thanks for your answer but unfortunately in this example default click is unbinded(.off("vclick")) but I want not remove anything but only add long press action and when long press will be detected then only this long press should execute, but when original short click will be triggered then original action should also work.
I've tried a few options and this is enough for adding second event which trigger some other action than default:
I've tried a few options and this is enough for adding second event which trigger some other action than default:
Code:
let lastMousedown;
motionsIcons.on("vmousedown",function(e) {
lastMousedown = e.timeStamp;
});
motionsIcons.on("vmouseout",function(e) {
let currentMouseout = e.timeStamp;
if ((currentMouseout - lastMousedown) > 1000 && (currentMouseout - lastMousedown) < 3000) {
let value = grp.getvalue(motion.disabling);
grp.write(motion.disabling, !value);
}
});