I get mouse position with simple code:
$("#container").mousemove( function(e) {
client_x = e.pageX;
client_y = e.pageY;
// save coordinates
});
But I need only the start and stop coordinates + coordinates when mouse change direction, so I can “copy” mouse movements.
I think I need some kind of timer to see if mouse stoped for some interval?
This is constantly settings and clearing timers. If the mouse stops for 1 second the
doCopy()function gets triggered.