XI2 relative motion events documentation

Peter Hutterer peter.hutterer at who-t.net
Tue Oct 19 15:41:50 PDT 2010


On Fri, Oct 15, 2010 at 11:57:48PM -0500, Rendaw wrote:
>  I played around with the valuator data a bit.  In a XI_RawMotion
> event, the valuators.values and corresponding raw_values both return
> relative motion data, but they are way different.  I'm not sure by
> how much exactly, but for my mouse the raw_values were several
> orders of magnitude smaller.  However, the valuators.values were in
> turn smaller than the actual cursor coordinate changes, usually by
> about half, although sometimes (randomly, even at larger values)
> they were equal.

http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XI2proto.txt#n1557

"A RawEvent provides the information provided by the driver to the client.
RawEvent provides both the raw data as supplied by the driver and
transformed data as used in the server. Transformations include, but
are not limited to, axis clipping and acceleration.  Transformed
valuator data may be equivalent to raw data. In this case, both raw and
transformed valuator data is provided.
RawEvents are sent exclusively to all root windows or to the client that
grabbed the device only."

all valuator data is always in device coordinates, so as Daniel said you
need XIQueryDevice to get the axis ranges and then scale appropriately.

Cheers,
  Peter

> Also perhaps of note, only the slave device reported raw events when
> there was the WM's passive grab (when I had a button down) in place.
> Only the master device reported raw events otherwise.  I'm not sure
> what to make of that, although I guess it makes my life easier for
> now.
> 
> Anyways, the valuator data is better than nothing, but I'm not sure
> how to interpret it if it is neither the final motion data nor the
> raw motion data.


More information about the xorg-devel mailing list