title: How does a mouse driver move the mouse pointer?
body: <p>This might be kind of a strange question, but how does the software for a mouse work? (specifically on OSX)</p>
  
  <p>If I want to move the mouse around on OSX, I've been using this code:</p>
  
  <pre><code>CGAssociateMouseAndMouseCursorPosition(0);
  CGWarpMouseCursorPosition(point); // point is of type NSPoint
  CGAssociateMouseAndMouseCursorPosition (1);
  </code></pre>
  
  <p>But this causes the cursor to jump (and even lag occasionally). How does a mouse (or trackpad) make it so fluid? What APIs do they use?</p>
  
  <p>Likewise, if I use this code to move the cursor over the dock, for example, the dock doesn't magnify (magnification is turned on), even though moving the cursor there normally using the trackpad works just fine. Why?</p>