Patch to mouse accel code [and deceleration code]

Jan Brunner brunner at intergga.ch
Fri Nov 12 09:56:04 PST 2004


> It seems that the patch does not remove the use of the C x86 float type.
> 
> The patch: http://freedesktop.org/bugzilla/attachment.cgi?id=1147

This patch is my first version. The one I'd still prefer at the moment.

> Maybe integers would be OK if 2**16 is returned when an old mouse
> emitted one pulse when moving slowly.

That's one possibility I'm thinking of: Working with a big 2**n multiple 
of the numbers which could be calculated fast by left-shifting (except 
on P4s). The problem would be dividing back down. AFAIK shifting right 
doesn't give the wanted on all platforms so a normal division would have 
to be used (expensive).

The other way I'm thinking of is multiplying by ctrl.num which is a bit 
more expensive but perfectly accurate.

Both variants would bring 2 more variables as using integers only 
doesn't work for the exponential acceleration method (threshold = 0) if 
I did the math right.

> [..]
> Here is my explanation on how the X/XFree86 pointer ends up orbiting
> around the final resting point.
> [..]

I guess you want to implement something like WinXP uses. I don't oppose 
implementing something like this in the future as long as it can still 
be set to normal linear movement.

> That patch probably won't lead to visible improvements. Windows 2000
> has an enormously better mouse (and in Windows 2003 it got slower).

Are you speaking of my patch? It prevents constant rounding down of 
mouse movement when using non-integer num/den fractions. Nothing more, 
nothing less.

> Also, the "abs(dx) + abs(dy)" creates a diamond shape where the mouse
> is slower. There is a discontinuity at the edge thus the whole algorithm
> needs ot be much changed. To fix that, did not produce a worthwhile
> improvement (when I tried fixing that).

I know, the patch is mainly to allow using small fractions. I personally 
hate all kind of acceleration (the threshold one the most) and will 
probably never use it, regardless of the algorithm (When using a mouse. 
With a touchpad it can be useful.).

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



More information about the xorg mailing list