XInput2: getting window-relative coordinates?

Simon Thum simon.thum at gmx.de
Fri Apr 17 12:17:03 PDT 2009


Florian Echtler wrote:
> 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'm not sure about this, but I recall it may depend on whether you 
listen to a master device (screen coords) or a slave device (driver coords).
Anyway, make sure you're at the right set of coordinates:
DeviceEvent:
[...]
root_x
     root_y
         The position of the pointer in screen coordinates (16.16 fixed 
point).
     event_x
     event_y
         The position of the pointer in screen coordinates relative to the
         event window (16.16 fixed point).

(formatting broken, but I'm sure you get the idea.)

Cheers,

Simon



More information about the xorg mailing list