XInput2: getting window-relative coordinates?
floe at butterbrot.org
Fri Apr 17 08:45:15 PDT 2009
> after a bit more fiddling, I now have MPX and XI2 up and running. My
> software is receiving the new XI2 input events fine; however, I've
> noticed that the valuators are always in screen coordinates. Is there a
> way to get them in window coordinates, or do I need to use XGetGeometry
> to convert them?
More experimentation with my code and with "xinput test-xi2" now has me
totally confused. I created two master pointers, one is attached to an
USB mouse, the other to a Synaptics touchpad.
The first one (controlled by mouse) reports absolute screen coordinates
with evtype == XI_Motion - the values range from (0,0) to (xres,yres).
While window coordinates would be nice, that is about what I expect.
However, the second one (controlled by touchpad) reports values in the
range (1472,1408) to (5472,4448). This is also reported in the Xorg.log
by the synaptics driver. How can I map these to screen coordinates? As
the pointer still moves in screen coordinates, the mapping must already
exist somewhere, I assume..
I know that this is quite beta still, so I'd be very grateful about some
0666 - Filemode of the Beast
More information about the xorg