Detect mouse direction

Hi all,
I have another question please.

Take a look here:
http://filippasmedhagensund.com/#/beauty/nord/2/

you’ll see that after you start dragging - if dragged horizontally, unless you release the mouse-click the drag is locked on the horizontal line. Then if you drag vertically, it’s locked on a vertical drag, again untill you release the click.

I tried modifying the “detect mouse direction” tutorial from here, but i couldnt get it.

My question is how do i modify this tutorial so it will only run once (when a drag starts), detect the movement, stop running, and shoot the direction to the dragging function?

Hope I’m clear,
thanks in advance

Miki.

Solved :slight_smile:

If it intrests anybody, all I had to do is to add this.unwatch(“xdir”, checkX);
at every if statement.
the function will now be triggering again, for a one checl, at the next click.