How do I calibrate a touchscreen on a dual monitor system?
Solution 1
Have you tried using xinput-calibrator?
Solution 2
As Beni Cherniavsky-Paskin suggested in a comment, I used the following command to map an input device to an output screen:
xinput map-to-output <device> <output>
To figure out which is which, I first ran xinput
to list the input devices. From that listing, I observed that my touchscreen was "QUANTA Optical Touch Screen" and listed as device id 12. I then ran xrandr
to determine the touchscreen, which in my case was VGA1.
Simply entering the following command then did the trick:
xinput map-to-output 12 VGA1
Solution 3
As Beni Cherniavsky-Paskin and Paul Lammertsma suggested in above comments xinput map-to-output <device> <output>
did the trick for me!
you first need to run xinput
to get the id of inupt device,
the above command return something like this for me.
user@user-hpEnvy:~$ xinput
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ Logitech Unifying Device. Wireless PID:401b id=10 [slave pointer (2)]
⎜ ↳ Logitech Unifying Device. Wireless PID:4016 id=11 [slave pointer (2)]
⎜ ↳ ELAN20E7:00 04F3:20E7 id=13 [slave pointer (2)]
⎜ ↳ SynPS/2 Synaptics TouchPad id=15 [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)]
↳ Video Bus id=8 [slave keyboard (3)]
↳ Power Button id=9 [slave keyboard (3)]
↳ HP Truevision HD id=12 [slave keyboard (3)]
↳ AT Translated Set 2 keyboard id=14 [slave keyboard (3)]
↳ HP Wireless hotkeys id=16 [slave keyboard (3)]
↳ HP WMI hotkeys
Next I ran xrandr
to get the list of screens and the output of the command is like this
user@user-hpEnvy:~$ xrandr
Screen 0: minimum 8 x 8, current 3840 x 1080, maximum 32767 x 32767
eDP1 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 382mm x 215mm
1920x1080 60.0*+ 59.9 40.0
1680x1050 60.0 59.9
1600x1024 60.2
1400x1050 60.0
1280x1024 60.0
1440x900 59.9
1280x960 60.0
1360x768 59.8 60.0
1152x864 60.0
1024x768 60.0
800x600 60.3 56.2
640x480 59.9
HDMI1 connected primary 1920x1080+1920+0 (normal left inverted right x axis y axis) 600mm x 340mm
1920x1080 60.0*+ 50.0 59.9
1680x1050 59.9
1600x900 60.0
1280x1024 60.0
1440x900 59.9
1280x720 60.0 50.0 59.9
1024x768 60.0
800x600 60.3
720x576 50.0
720x480 60.0 59.9
640x480 60.0 59.9
720x400 70.1
VIRTUAL1 disconnected (normal left inverted right x axis y axis)
In my case the touch device is ELAN20E7:00 04F3:20E7 id=13
and touch enabled screen is eDP1
to fix the issue i need to map the device the that monitor only for that i ran this command xinput map-to-output 13 eDP1
Problem solved and its working fine again :)
I am using elementary OS freya, so it should work for all distros based on Ubuntu 14.04 LTS
Solution 4
Very hard to find solution but actually pretty straight forward, just follow the answer from 'phnomic' here: Touchscreen and additional external monitor. Works flawless with my Fujitsu T730 with all kinds of external monitors!
Related videos on Youtube
TheCodeGeek
Updated on September 18, 2022Comments
-
TheCodeGeek almost 2 years
I have a dual monitor setup of two different sizes. My primary monitor is a 23 in widescreen Acer T230H touchscreen, and the second is a regular 20 in. When I go to use the touchscreen, the cursor shows up on the secondary display depending on where I touch the display. How do I calibrate it to only control my primary monitor?
-
TheCodeGeek over 12 yearsAnyone? It has been three months. Anyone that can help me calibrate my touchscreen would be of great help.
-
-
Beni Cherniavsky-Paskin about 11 yearsThis uses xsetwacom, which I presume only works for Wacom devices? However there is a generic
xinput map-to-output <device> <output>
which is similar in spirit. -
user207863 over 7 yearsExact same command worked for me on my HP Envy 15-k016nr laptop with external monitor.
-
SimonT about 7 yearsThis worked perfectly on my Dell Inspiron 5547. Interestingly I used
id=13
which corresponds to myELAN Touchscreen
, even thoughSynPS/2 Synaptics TouchPad
is whatxinput-calibrator
was using by default. -
Stephen Angelico over 6 years
xinput-calibrator
did not help me. It spanned across the entire display space, which is not all accessible on my setup. I tried manually setting calibration values to the size and position of the touchscreen but it had no effect. The answers usingxinput map-to-output
were easier and more helpful. -
Wes over 6 yearsIs it possible to make this persistent?
-
JJones almost 6 yearsxinput ( at least as of version 1.6.2 allows you to use the device name instead of the ID ( which can change) . so the above xinput command becomes:
-
JJones almost 6 yearsxinput map-to-output 'QUANTA Optical Touch Screen' VGA1
-
JJones almost 6 yearsand you can use that command to make it persistent. For KDE you can use the Autostart program and enter that command with its options in "Add Program", or put it in a file, make it executable and select it from Autostart. For others try searching for: xinput startup and one of gnome, LWM or cinnimon etc.
-
Jordan Mackie over 4 yearsHey JJones, you should add the name version of that command to an actual answer rather than in the comments, it was really helpful! :)
-
gone over 4 yearsWorked for me, e.g.
xinput map-to-output 24 eDP-1-1
on a HP Spectre X360 2019-15. -
Vlad almost 4 yearsWorked for me also on a Lenovo Thinkpad T460 with external monitors. The device to be used is
Melfas LGD AIT Touch Controller
. This is also a good resource on the topic: wiki.archlinux.org/index.php/Touchscreen -
m3nda almost 4 yearsI saw that the elantech device gets different
id:
each boot, so I've ended up with a little helper script: gist.github.com/erm3nda/3eda9fbcb7a1c18dc91990f1d306c512. -
Pavel Polivka almost 4 years@m3nda you're replying to a comment made over 7 years ago, when there was only the 2011 answer and this one. I'll delete the comment I made back then to avoid further confusion, I imagine many better solutions exist nowadays.
-
user87317 almost 4 yearsThis worked for me but only if I do not mirror the two monitors. If I mirror them it is not correctly calibrated. I tried playing around with the resolutions of the mirrored monitor(s) but I couldn't get them to work