Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Normalize and smooth the mouse movements?

Tags:

c#

mouse

Is there a way to smooth out the mouse movements? I want to remove all the small jitter in normal mouse moving with the hand, like you can never draw a clean line in paint because of you hand doing small jittering movements.

This might be hard to understand what I mean, but if you know zbrush they have a feature that is called lazy mouse http://www.pixologic.com/docs/index.php/Lazy_Mouse im looking for a way to recreate this inside my app. I can read the mouse position with Cursor.Position but I don't find a way to average out these numbers before they get sent to the pointer on the screen.

like image 597
Darkmage Avatar asked Nov 01 '11 13:11

Darkmage


People also ask

How do I make my mouse move smoother?

In the search box, type mouse, and then click Mouse. Click the Pointer Options tab, and then do any of the following: To change the speed at which the mouse pointer moves, under Motion, move the Select a pointer speed slider toward Slow or Fast.

What is mouse movement?

Mouse movements can be used to infer a user's intent and focus while browsing a website. By using mouse movements in usability testing, researchers can determine if users are confused, if their expectations are met, where their attention is focused, and much additional information.


1 Answers

This is only possible if you can delay the effect of the mouse movement slightly. You record the points of the mouse movement at a certain frequency and then average them out to a line. Then use that line to draw whatever you need. You wont be able to directly set the mouse cursor to the averaged position as that would then feedback into your program as a new mouse movement.

Make sure you build it so you can tweak how long you delay the mouse movement, and how aggressive the averaging is (say by restricting the number of points it includes), and the frequency at which you record mouse movements (this is could affect cpu usage if its too frequent).

You will of course have to create some sort of abstraction for the mouse in your application and create a way for the application to get hold of it. (I would be trying to keep this as similar as possible to normal winforms/wpf so I could revert the change and just use mouse movement directly if needed).

like image 60
ClearCarbon Avatar answered Oct 11 '22 23:10

ClearCarbon