title: Detect mouse movement if Cursor is locked
body: <p>I am developing Cad application and want to implement snap - when user moves mouse near some object, I set Cursor.Position to the center point of that object. If user moves mouse say 7 pixels in any direction, then Cursor is set free.The way I do it is - I store snaped Cursor position and then under MouseMoveEvent I calculate the distance from stored position to current position. If this position is smaller than defined threshold then I set current cursor position back to stored value. Every time MouseMoveEvent is called that small difference between two cursor positions is added to previously calclated difference, so sooner or later my threshold is reached and Cursor jumps out of snaped position. Code sample:</p>
  
  <pre><code>   var x = Cursor.Position.X - storedPosition.X;
     pixelsX += x;
  
     int threshold = 7;
     if (pixelsX &gt; threshold)
     {
            Cursor.Position = new System.Drawing.Point(storedPosition.X + 10, storedPosition.Y);
            snapReleased = true;
     }
  </code></pre>
  
  <p>The problem with this is that in every MouseMoveEvent mouse is moved very small amount and if threshold is not reached it is set back to stored position which makes Cursor blink(which is very annoying) So my question is - is there a way to detect mouse movement if Cursor is locked in one position?</p>