Trivial change to mouse acceleration code would make it less bad

Jan Brunner brunner at intergga.ch
Sat Oct 16 08:09:26 PDT 2004


Hello.

I read the mouse acceleration code in xf86Xinput.c and noticed that 
there are 2 different formulas depending on whether threshold is 0 or 
not. The formula for threshold != 0 applies the standard method of 
acceleration while the one for 0 applies an exponential one.

Now I personally don't like any kind of mouse acceleration but the 
exponential method uses the variables dxremaind and dyremaind to prevent 
accumulation of rounding errors which is a very good idea.

When a user has a mouse with a high resolution, he might want to use for 
example "xset m 1/2 1" to halve the pointer speed but with the current 
implementation this makes the pointer stall when the mouse is moved 
slowly. (In this case, "xset m 1 0" could have been used for the wanted 
effect but this is a coincidence.)

That's why I suggest that the old acceleration code uses the 
dxremaind/dyremaind variables, too.

Long term, the method proposed by Eugenia [1] look promising although 
I'm against scaling the pointer movement according to screen resolution 
but short term, my proposed change would allow freely scaling the mouse 
speed without the mentioned problem and without breaking any 
compatibility (I hope).

[1] http://freedesktop.org/bugzilla/show_bug.cgi?id=138

-- 
Best Regards,
Jan Brunner <brunner at intergga.ch>



More information about the xorg mailing list