Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Jun 2007 11:56:47 +0200 (CEST)
From:      Oliver Fromme <olli@lurza.secnetix.de>
To:        freebsd-current@FreeBSD.ORG, h.schmalzbauer@omnisec.de
Subject:   Re: moused linear acceleration drops
Message-ID:  <200706150956.l5F9ulsc067286@lurza.secnetix.de>
In-Reply-To: <200706151055.01446.h.schmalzbauer@omnisec.de>

next in thread | previous in thread | raw e-mail | index | archive | help
Harald Schmalzbauer wrote:
 > Oliver Fromme wrote:
 > > My patch only added -A (dynamic acc) but did not touch the
 > > algorithm of -a (linear acc).  If you observe the problem
 > > when using -a but not -A, then there are two possibilities:
 > > 
 > > 1.  My patch _did_ introduce a regression with -a, or:
 > > 2.  The problem already existed before my patch.
 > 
 > I suspect the latter.

Me too.  The old (unpatched) code looks like this:

        mouse.u.data.x = action2.dx * rodent.accelx;
        mouse.u.data.y = action2.dy * rodent.accely;

The accelx and accely variables are floats, all others are
integers, so the result is rounded down.  If the mouse
reports 1 unit of movement, you get 1 * 0.333 rounded
down, which is 0, so no movement is reported to X11.
Even two units (2 * 0.333) get rounded down to zero.
So you have to have at least three units to get any
pointer movement at all.

The proper fix would be to accumulate the rounding
errors and take them into account at the next movement.

Should be easy to fix.  "I'll look at it."

(BTW, I also verified that moused still uses the exact
same code if the -A option isn't used, so it's not a
regression of my patch.  *phew*  :)

 > > By the way, what kind or model of a mouse do you have
 > > there?  Maybe I'm able to get hold of one, so I can
 > > reproduce the problem more easily.  The most sensitive
 > > mouse in my collection seems to have only 600 dpi.
 > 
 > It's a Saitek Laser mouse. I checked these for polished surfaces and it's even 
 > working on glass if you stick some milky sheet _under_ the glass, which 
 > doesn't destroy the clean surface optic. (btw, the logitech laser mice didn't 
 > work on the described glass table!)
 > I have one spare in stock, I can put it in your letter box if I'm downtown 
 > next time (planned for this afternoon, but weather forecast predicts hail.... 
 > so not sure)

See my private mail.

Best regards
   Oliver

-- 
Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M.
Handelsregister: Registergericht Muenchen, HRA 74606,  Geschäftsfuehrung:
secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün-
chen, HRB 125758,  Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart

FreeBSD-Dienstleistungen, -Produkte und mehr:  http://www.secnetix.de/bsd

"Being really good at C++ is like being really good
at using rocks to sharpen sticks."
        -- Thant Tessman



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200706150956.l5F9ulsc067286>