touchscreens in multiscreen setups

David De La Harpe Golden david.delaharpe.golden at gmail.com
Wed Aug 5 16:07:13 PDT 2009


2009/8/3 Peter Korsgaard <jacmet at sunsite.dk>:
> Now, with xrandr instead of Xinerama there is only one screen and the
> above doesn't work (the coordinates gets scaled to the entire screen
> instead of the individual outputs).
>
> What is the suggested solution for this? Add randr output tracking to
> evtouch or should evdev handle this instead?
>

FWIW - I have a wacom tablet, I presently (ab)use the four wacom
"calibration" properties to map input device' core pointer updating to
particular screen subregions.   I keep meaning to wrap a friendly
systray applet around it to do it on the fly.  I've never used
evtouch, a similar trick might work there though:

Basically, if a driver has a wacom-like facility, where rectilinear
calibration uses TopX/TopY/BottomX/BottomY  coords in device space and
 allows large positive and negative values for them, you can (ab)use
them to map the tablet's zero-to-m/zero-to-n xy area in device space
to any rectangular subarea of your screen in pixel space if you want.
Make them correspond to subarea that aligns with the output you want
it to align with, and you're done.   The basic trick is to set the
TopX/TopY to the top-left of the X11 screen ...in tablet-relative
device coordinates! (picturing the tablet area laid atop the screen
area), and similar for the BottomX/BottomY and the bottom-right of the
X11 screen.  (If you actually need some actual calibration too, well
the maths gets trickier)

But it could even be that input devices offering those four parameters
is all that's necessary for an adequate solution for absolute input
devices and xrandr multihead, so long as you don't mind roundtripping
on randr reconfigurations (the systray thingy would need to watch for
reconfigurations, introspect the new configuration, and recalculate
the appropriate device calibration parameters).

e.g. Here's what I use to statically align wacom input devices of a
1280x1024 screen /  7220x5780 device cintiq below a 1600x1200 screen:

	Option          "TopX"          "0"
	Option          "TopY"          "-6773"
	Option          "BottomX"       "9025"
        Option          "BottomY"       "5780"

Note the huge negative value for TopY - that's so that the driver is
"fooled" into thinking the tablet covers the whole X11 screen with a Y
axis from -6773 to 5780, and since the X11 screen is a rectangle and I
have a dead area to the right of the 1280x1024 screen, I also need to
account for that with the BottomX value.
5780 * 1200 / 1024  = 6773 (ish)
7220 * 1600 / 1280  = 9025

This is actually a similar trick  to the "lockstep multihead
proportional panning" trick outlined in the proportional panning patch
I sent a bit back (that I do mean to do a revised version of... just
working at glacial pace...)



More information about the xorg mailing list