I’ve been facing this problem for years and I finally decided to try and find the answer to it. I use something like this code to detect the speed of the movement of a dragged object
if (!go) {
this["position_"+i] = this._y;
i++;
if (i == 3) {
i = 1;
}
delta_y = this.position_2-this.position_1;
}
This way I can find in what direction the mouse vertically has moved and at what speed. The problem is that every once in a while the speed will be in the opposite direction. What do people use to detect the direction of the movement of the mouse?