title: Smooth Mouse Movement using mouse_event with set delay C++
body: <p>I'm coding a mouse macro. It needs to meet certain points on the screen in a set delay between each point. For exammple, it must move (x 14, y 30) in 132ms. The issue I'm having is mouse_event jumps to that exact position so I need to include some sort of smoothing method so that it moves smoothly to each point. (the smoother the movement is the better the macro). Currently I am using this method of smoothing each movement.</p>
  
  <p>This works well but it has its limitations for example if it needs to move 10 pixels left and the smoothing is set to 20 it will continue to jump.</p>
  
  <p>Does anyone know of a more accurate method of smoothing mouse movements? (requirements accurate, smooth)</p>
  
  <pre><code>void Smoothing(int smoothing, int delay, int x, int y) {
      for (int i = 0; i &lt; smoothing; i++) {
          mouse_event(1, x / smoothing, y / smoothing, 0, 0);
          AccurateSleep(delay / smoothing);
      }
      mouse_event(1, x % smoothing, y % smoothing, 0, 0);
      Sleep(delay % smoothing);
  }
  
  
  </code></pre>