libinput "mouse mode" for tablets

Peter Hutterer peter.hutterer at who-t.net
Thu Jan 30 15:18:19 PST 2014


On Thu, Jan 30, 2014 at 02:14:30PM -0800, Bill Spitzak wrote:
> It is not clear from this discussion what support there will be for
> "mouse mode" for the tablets.
> 
> A problem I have had with the current tablet api is that it is
> designed for mapping the tablet to the bounding box surrounding all
> the outputs. "mouse mode" simply means that the movement is relative
> and does not change this scaling.
> 
> What is wanted in mouse mode is a fixed translation of a 1" square
> on the tablet to a square in output space. Other operating systems
> do this when you switch to mouse mode. I have to run a rather
> annoying Python program every time the screen layout is changed to
> calculate the very non-intuitive rectangle I have to send to the
> mouse driver.
> 
> Also I only want mouse mode when I have two outputs. If I have one
> the tablet can be used in direct mode. This may also be true if a
> program could grab the tablet and direct it to it's window that
> turning off mouse mode would be useful. I also have a smaller tablet
> that I would like to be in mouse mode all the time.
> 
> I think a much more intelligent version can be done, which
> automatically goes into mouse mode. Basically the user chooses how
> big a 1-inch square on the tablet turns into in output space, and a
> limit to how distorted this output square can be (perhaps from 1.5:1
> to 1:1.5). On every change of the tablet or outputs wayland/libinput
> then figures out a mapping that is not too far from this scale and
> within the distortion dimensions for non-mouse-mode, if that is
> impossible it goes to mouse mode.

this has so many more cases where it won't work correctly from the user's
POV that it's likely easier to just have an easily accessible way of
switching between absolute and relative mode.

other than that, there will be support for relative mouse mode on tablet
hardware. Your general use-case is not unique, though I don't think I've
heard of the the case of mapping a tablet area to the exact screen area
before. Mapping it so that a square is a square, yes, but the requirement
for exact size matches is new to me.

Cheers,
   Peter

> I don't know if this would be libinput or the compositor but the
> ability to do this would be a nice addition to Wayland.


More information about the wayland-devel mailing list