↓ Skip to main content

Touch and no-touch monitors combined on linux

·396 words·2 mins
 Author
Author
Michael Bretterklieber
Software Developer

If you are using multiple physical screens, and not all screens are supporting touch, you have to map the touch device to the video output. By default, the touchscreen device is handled like a touchpad, which means, that it is active over the complete combined screen of all monitors.

In my case, I am using the laptop and the left-side, which has an integrated touch device, the main monitor in front without touch and on the right side another monitor with touch support in portrait mode (rotated by 90 degrees).

At the and the touch should be handled for each monitor individually and take into account, that the monitor on the right side is rotated.

First, locate the touch devices.

xinput

xinput shows this output:

⎡ Virtual core pointer                    	id=2	[master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer              	id=4	[slave  pointer  (2)]
⎜   ↳ LXST2021:00 29BD:9902                   	id=10	[slave  pointer  (2)]
⎜   ↳ ELAN0688:00 04F3:320B Mouse             	id=11	[slave  pointer  (2)]
⎜   ↳ ELAN0688:00 04F3:320B Touchpad          	id=12	[slave  pointer  (2)]
⎜   ↳ TPPS/2 Synaptics TrackPoint             	id=14	[slave  pointer  (2)]
⎜   ↳ M585/M590 Mouse                         	id=16	[slave  pointer  (2)]
⎣ Virtual core keyboard                   	id=3	[master keyboard (2)]
    ↳ Virtual core XTEST keyboard             	id=5	[slave  keyboard (3)]
    ↳ Video Bus                               	id=6	[slave  keyboard (3)]
    ↳ Power Button                            	id=7	[slave  keyboard (3)]
    ↳ Sleep Button                            	id=8	[slave  keyboard (3)]
    ↳ HID 046a:0011                           	id=9	[slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard            	id=13	[slave  keyboard (3)]
    ↳ ThinkPad Extra Buttons                  	id=15	[slave  keyboard (3)]
    ↳ M585/M590 Keyboard                      	id=17	[slave  keyboard (3)]

The is an unknown device LXST2021:00 29BD:9902.

A crosscheck with dmesg

dmesg | grep "LXST2021:00"

shows:

[    1.296277] input: LXST2021:00 29BD:9902 Touchscreen as /devices/platform/AMDI0010:00/i2c-0/i2c-LXST2021:00/0018:29BD:9902.0002/input/input10

This seems to be the touchdevice of my laptop, all we have to is to map the input device to the output. xrandr shows eDP (embedded DisplayPort), which is typically a laptop display.

xinput map-to-output 10 eDP

10 is the id shown by `xinput, you can also use the name of the touch device:

xinput map-to-output "LXST2021:00 29BD:9902" eDP

So far so good, now let us configure the touch device of the monitor on the right side.

xinput shows another input device

Weida Hi-Tech                CoolTouchR System

xrandr shows the monitor on the HDMI port (the only one in use)

HDMI-A-0 connected 1080x1920+4480+17

now, map the touch device to the HDMI output:

xinput map-to-output 18 HDMI-A-0

done