Ubuntu Select Touch Device

I have a thinkpad laptop with a touchscreen. When I connect my external screen, then the touch sensor on my laptop screen moves the cursor on the external screen, which is not what I want. I want to keep my touch on my laptop screen.

I followed the instructions here: https://askubuntu.com/questions/51445/how-do-i-calibrate-a-touchscreen-…

First run:

xinput

Output:

⎡ Virtual core pointer                          id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ ELAN Touchscreen                          id=11   [slave  pointer  (2)]
⎜   ↳ ETPS/2 Elantech Touchpad                  id=13   [slave  pointer  (2)]
⎜   ↳ ETPS/2 Elantech TrackPoint                id=14   [slave  pointer  (2)]
⎣ Virtual core keyboard                         id=3    [master keyboard (2)]
   ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
   ↳ Power Button                              id=6    [slave  keyboard (3)]
   ↳ Video Bus                                 id=7    [slave  keyboard (3)]
   ↳ Power Button                              id=8    [slave  keyboard (3)]
   ↳ Sleep Button                              id=9    [slave  keyboard (3)]
   ↳ Integrated Camera: Integrated C           id=10   [slave  keyboard (3)]
   ↳ AT Translated Set 2 keyboard              id=12   [slave  keyboard (3)]
   ↳ ThinkPad Extra Buttons                    id=15   [slave  keyboard (3)]

I found that my internal laptop screen is the "ELAN Touchscreen" with ID 11.

Then run:

xrandr

Output:

Screen 0: minimum 320 x 200, current 3840 x 1080, maximum 16384 x 16384
eDP connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 309mm x 173mm
  1920x1080     60.01*+
  1680x1050     60.01   
  1280x1024     60.01   
  1440x900      60.01   
  1280x800      60.01   
  1280x720      60.01   
  1024x768      60.01   
  800x600       60.01   
  640x480       60.01   
HDMI-A-0 connected 1920x1080+1920+0 (normal left inverted right x axis y axis) 600mm x 340mm
  1920x1080     60.00*+ 144.00   120.00   100.00   119.88    50.00    59.94    30.00    25.00    24.00    29.97    23.98   
  1680x1050     59.88   
  1600x900      60.00   
  1280x1024    143.85   119.96    75.02    60.02   
  1440x900      60.00   
  1280x800      59.91   
  1152x864      75.00   
  1280x720      60.00    50.00    59.94   
  1024x768     119.99    75.03    60.00   
  832x624       74.55   
  800x600       75.00    60.32   
  720x576       50.00   
  720x480       60.00    59.94   
  640x480       75.00    60.00    59.94   
  720x400       70.08   
DisplayPort-0 disconnected (normal left inverted right x axis y axis)
DisplayPort-1 disconnected (normal left inverted right x axis y axis)

xrandr shows me my primary screen ID is "eDP".

To map the touchscreen back to my primary screen, I use following command:

xinput map-to-output 11 eDP

Happy coding!

You might want to add the command to a startup script: https://networks.guru/2018/11/23/using-dual-monitor-dual-touch-screens-…

Last modified
2021-07-17