Let's try 8 ticks instead of 10, and don't reset the count when moving in the opposite direction. Faster mouse movement triggers less mousemove events per distance travelled.