This is only possible if you can slow down the mouse movement a little. You record mouse movement points at a specific frequency, and then line them up. Then use this line to draw everything you need. You cannot directly position the mouse cursor in the average position, as this will lead to feedback in your program as a new mouse movement.
Make sure that you create it so that you can set the time for delaying the movement of the mouse and how aggressive the averaging is (for example, by limiting the number of points included in it) and the frequency with which you record the movements of the mouse (this can affect the use of the processor if it is too often).
Of course, you have to create some kind of mouse abstraction in your application and create a way so that the application can hold it. (I would try to make it as similar as possible to regular winforms / wpf, so that I can undo the change and just use the mouse movement directly if necessary).
Clearcarbon
source share