libinput "mouse mode" for tablets

Bill Spitzak spitzak at gmail.com
Thu Jan 30 14:14:30 PST 2014


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.

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