How do I calibrate a touchscreen on a dual monitor system?

13, May. 2024

 

How do I calibrate a touchscreen on a dual monitor system?

I ran into a similar issue. I switch between using 2 and 4 touch screen monitors, all of which show the exact same name and changing device ID's, making all of the solutions I found pretty much useless. So, I wrote my own script. It captures the the ID's using xinput and the xrandr to capture the available displays. If you don't have Yad installed, it will attempt to install it.

Check now

It then uses Yad to popup a confirmation box in the corners of your monitors. Click ok, if the click does not hit the 'OK', it assumes your display and touch inputs are mismatched and attempts to match to the next until you actually hit 'OK'. Then it moves on to the next monitor.

This has to be ran everytime I log in, whether it's a reboot or my system was locked, but I set mine to run when I hit win+f (F for fix my crap), so it's pretty quick and painless to reset everything. I've yet to find a way to make it persistent. I also keep the code on git-hub. Any updates I make, I will post there (https://github.com/pvtcompyle/set-touch). If anyone can think of a way to make this kind of setup persistent, I would love to hear about it!

#!/bin/bash
# This script requires yad to be installed. If it is not installed, run:
# sudo apt install yad

# check for yad installation
monkg -l "yad"
if [ $? = '1' ]
then
   printf "Yad is not installed"
   sudo apt install yad
fi

# run xinput and find the search text for your touch screens, then set it below
screenSearch="Touch"
# run xrandr and find the search text for your monitors, then set it below
monintorSearch="DisplayPort-"

# dump xinput id's xrandr monitor searches into arrays
idArr=($(xinput | grep $screenSearch | awk '{gsub("id=",""); print $7}'))
monArr=($(xrandr | grep -E "$monintorSearch[0-9] connected" | awk -F '[-" "]' '{print $2}'))
cdate=($(date -I'seconds'))

# these are x and y coordinates to place pop-up alerts.
# adjust for your preference, screen resolution, and number of monitors.
# if fewer monitors are detected than are defined here, it's ok.
# to find your coordinates run the following from a terminal:
# yad --posx=<number> --posy=<number>
monx=(1620 2120 1620 2120)
mony=(880 880 1180 1180)

# loop through monitors. 
for mon in "${monArr[@]}"
do
   index=0
   declare -i mon
   # loop through touch screen id's
   for id in "${idArr[@]}"
   do
      declare -i id
      xinput map-to-output $id $monintorSearch$mon
      # pop up box at monx and mony coordinates. Tap OK, if it's registered on the wrong screen, it will prompt again.
      yad --posx=${monx[$mon]} --posy=${mony[$mon]} --close-on-unfocus --title="stuff" --text="Matching input: $id to Monitor: $mon."
      result=$?
      case $result in
         0)
            idArr=(${idArr[@]/$id})
            break
            ;;
         252)
            ((index=index+=1))
            ;;
         *)
            echo 'Unknown input' $result 
            ;;
      esac
   done
done

Wireless Touch Screen Monitors - Hardware

feels good to dream

Here is the closest ways to get to your ideal situation.

With competitive price and timely delivery, Touch-China sincerely hope to be your supplier and partner.

Most touch screens can handle multiple fingers; however even those of us who type fast don’t press 10 keys at the same time; so 10 fingers would be a lot to take in. Otherwise, get one of those bluetooth keyboards that are connected in a case (if you need to have your fingers hovering on top of some keys).

You should know that Ipad, Iphones and Imacs connect to the television wirelessly if you have an Apple TV.

All of the mentioned Apple devices will surely give you more then 4 hours.

If you want to connect to your desktop; then download the Logmein app and remote into your desktop.

The company is the world’s best Customized Touch Monitor Solutions supplier. We are your one-stop shop for all needs. Our staff are highly-specialized and will help you find the product you need.