[PATCH evdev] evdev: added property Evdev Axes Rotation. #27688

Simon Thum simon.thum at gmx.de
Sun Nov 7 07:17:15 PST 2010


On 11/02/10 08:45, Peter Hutterer wrote:
> On 2/11/10 17:41 , Peter Korsgaard wrote:
>>>>>>> "PH" == Peter Hutterer<peter.hutterer at who-t.net>  writes:
>>
>> Hi,
>>
>> PH>  right, that's the easy part. right now the property isn't hooked
>> up for
>> PH>  relative devices, so afaict that needs to be the first step. A
>> quick hack
>> PH>  shows some rather weird results, which suggests that it's not
>> quite as
>> PH>  trivial as I hoped it'd be.
>>
>> What kind of results are you seeing?
> 
> essentially what I did was change DeviceSetTransform() to write the
> matrix in as-is for relative devices (skipping scale and transform) and
> use transformAbsolute() in GetPointerEvents for relative events. That
> calculated the right values, but acceleration was off, the movement
> wasn't consistent with the pointer sometimes feeling like stuck in goo.
> It was a quick hack to try it, but that's what I meant with "not quite
> as trivial"
> 
I guess I would have found a few minutes to do it if it was that trivial.

The bottom of my coffee mug tells me you were screwing the remainder.
You really should be doing this in tune with acceleration, i.e. use the
same way of remainder handling and the same remainder. This is buried in
http://cgit.freedesktop.org/xorg/xserver/tree/dix/ptrveloc.c#n1073

A correct implementation might simply apply the 2x2-Part of the matrix
to driver input ([dx,dy] in the linked code), thereby converting it to
the equivalent of [fdx, fdy].

But then it's not simply c-n-p since you can't use the conditional axis
processing trick I used in accel (which isn't really smart anyway), so
the int->float->int+rem needs to be stabilized by other means.

The problem is that with a 0.5 remainder on an axis but motion only on
another axis, you'll still get a +1 axis with a -0.5 remainder. The axis
'toggles' as a result. So be aware of rounding and stay within remainder
[-0.5, 0.5].

Apart from that, it's probably cheesecake.

Cheers,

Simon


More information about the xorg-devel mailing list