XInput transform matrix

Peter Hutterer peter.hutterer at who-t.net
Wed Jun 13 21:43:30 PDT 2012


On Wed, Jun 13, 2012 at 05:46:19PM +0200, Cedric Sodhi wrote:
> Can anyone tell me which transform matrix (prop 133 in XI) I have to

fwiw, the numerical value may be different on each machine (even on each
startup), it purely depends on how many other properties were created before
this one. only a handful of atoms have real fixed values, they're named
XA_...  (XA_ATOM, XA_CARDINAL, etc.)

> choose so that my touchscreen lines up with my 90 ccw rotated display?
> I've tried practically everything I found sensible but I got absolutly
> no useful results. In fact I get a jumping and flickering cursor, which
> also maps differently based upon which direction I move in.

the rotation matrix is defined as

    [ cos -sin 0 ]
    [ sin cos  0 ]
    [ 0    0   1 ]

so for a 90 degree rotation you'd use 0 -1 0 1 0 0 0 0 1. However, it's
important to remember you're rotating around the origin, so if you do rotate
you need to offset too, so the above example actually becomes.

    [ 0 -1 1 ]
    [ 1  0 0 ]
    [ 0  0 1 ]

The offset is the important bit, forget about it and you get the cursor
stuck in corners or edges.

Cheers,
  Peter


More information about the xorg-devel mailing list