Is there any way to accelerate the mousemove event?

If you want to increase the reporting frequency, I’m afraid you’re out of luck. Mice only report their position to the operating system n times per second, and I think n is usually less than 100. (If anyone can confirm this with actual specs, feel free to add them!)

So in order to get a smooth line, you’ll have to come up with some sort of interpolation scheme. There’s a whole lot of literature on the topic; I recommend monotone cubic interpolation because it’s local, simple to implement, and very stable (no overshoot).

Then, once you’ve computed the spline, you can approximate it with line segments short enough so that it looks smooth, or you can go all-out and write your own Bresenham algorithm to draw it.

If all this is worth it for a simple drawing application… that’s for you to decide, of course.

Leave a Comment