I want to stop the routine and display a specific feedback if participants’ mouse stops moving for a certain amount of time. I understand in JS there is a timeout function, but I am unsure how to incorporate this into the code. Currently, I have:
document.onmousemove = function(){
clearTimeout(timeout);
timeout = setTimeout(function(){
abort = 2;
continueRoutine = false;
fdbk_to_draw = "Please keep moving your mouse.";
}, 10000);
}
But this does not give me what I want.