[PATCH libinput 5/7] tablet: add support for relative x/y motion deltas

Bill Spitzak spitzak at gmail.com
Mon Jan 18 09:54:09 PST 2016

On 01/17/2016 02:26 PM, Peter Hutterer wrote:
> On Fri, Jan 15, 2016 at 12:06:27PM -0800, Bill Spitzak wrote:
>> Isn't dx_unaccelerated exactly equal to the differences between x values?
> hah, yes. indeed. that actually means we can drop it from the API since a
> client can use the mm value instead, they are effectively equivalent (but
> more useful) than the raw device coordinates and account for uneven
> resolution better anyway.

I think the following text is confusing and is what led me to think that 
the coordinate systems might be different:

 >>> +libinput calculates the relative motion vector for each event and 
 >>> +it to the same coordinate space that a normal mouse device would use.

I guess that all coordianates except for raw ones are "converted to the 
space that a normal mouse device would use" but this seems to imply that 
dx/dy are special. Maybe this text can be moved somewhere to make it 
clear it applies to everything other than raw output.

> Whether you use the device in an absolute or relative mode is a very
> user-specific thing, I doubt you can handle this automatically. mode is also
> a very tool-specific thing, you may want the mouse to be in relative mode
> but the pen in absolute mode.

Although some devices such as the mouse may want to be in relative mode 
all the time, I believe the "absolute" devices will want to be in 
relative mode if the mapping from the tablet to the screen is either too 
large of a scale-up (ie the screen is much larger than the tablet) or 
the aspect ratio is significantly different (though this might just mean 
that one dimension is scaled beyond a maximum). This is certainly true 
of my current setup and I can't believe it is uncommon. Absolute mode on 
this tablet is completely useless! Except for programs that restrict the 
motion to a smaller window that is about the shape of the tablet.

I think this would also help it guess the correct mode automatically 
when the user changes their tablet or their screens.

More information about the wayland-devel mailing list