2

Can someone please assist me, I'm pulling my hair out here. I've been trying for days to figure this out.

Ubuntu 18.04.4 Display Set: Right Touch Frame: IRTOUCH System

If i use the following command in terminal to try calibrate my touch i get the following results

xinput set-prop "USB Touchscreen 6615:0001"  --type=float "Coordinate Transformation Matrix" 0 1 0 -1 0 1 0 0 1

My left/right is correct but my Up/Down is incorrect

if i use

xinput set-prop "USB Touchscreen 6615:0001"  --type=float "Coordinate Transformation Matrix" 0 -1 1 1 0 0 0 0 1

My left/right is incorrect but my Up/Down is correct

I'm trying to figure out what combination to use to configure my touch correctly. I've tried installing the driver which i downloaded from the manufacturer but that also does not work. Does anyone know what "Coordinate Transformation Matrix" i must use to get my Left/Right and Up/Down working correctly.

2 Answers 2

2

I managed to figure this out. There are 2 different Coordinate Transformation Matrix combinations for this particular touch frame. This depends on the screen rotation and if the touch panel has been mounted correctly or incorrectly "upside down"

Left Screen Rotate - Correct Mount Touch Panel xinput set-prop "USB Touchscreen 6615:0001" --type=float "Coordinate Transformation Matrix" 0 -1 1 -1 0 1 0 0 1

Left Screen Rotate - Incorrect Mount Touch Panel xinput set-prop "USB Touchscreen 6615:0001" --type=float "Coordinate Transformation Matrix" 0 1 0 1 0 0 0 0 1

Right Screen Rotate - Correct Mount Touch Panel xinput set-prop "USB Touchscreen 6615:0001" --type=float "Coordinate Transformation Matrix" 0 1 0 1 0 0 0 0 1

Right Screen Rotate - Incorrect Mount Touch Panel

xinput set-prop "USB Touchscreen 6615:0001" --type=float "Coordinate Transformation Matrix" 0 -1 1 -1 0 1 0 0 1

Hope this helps someone in the future

1
  • marvelous, I was struggling for one hour wiith this rotation matrix Commented Sep 27, 2021 at 2:15
0

Just in case someone else stumbles over this thread looking for a way to configure a pointer to a display using a certain rotation, I'll link my script here: https://github.com/SimonLammer/dotfiles/blob/0b98315b06b9393df6235457007b84831f1646f5/data/scripts/xinput-configure-pointer

#!/bin/sh
# Limits a pointer to a display with an orientation.
# This can be used to limit a rotated graphics tablet to one display.

set -e

ZENITY='zenity --width 500 --height 500'

# Select pointer
pointers=`xinput | grep pointer | tail -n +2 | sed -E 's/[^a-zA-Z0-9]*((\S+ ?)+[a-zA-Z0-9\(\)]+)\s*id=([0-9]+)\s*(.*)/"\3" "\1" "\4"/'`
#echo $pointers
pointer=`echo $pointers | xargs $ZENITY --list --text "Choose a pointer" --column Id --column Name --column Info`
#echo $pointer

# Select display
displays=`xrandr | grep \ con | sed -E 's/(\S+)[^0-9]*(.*)/"\1" "\2"/'`
#echo $displays
display=`echo $displays | xargs $ZENITY --list --text "Choose a display" --column Id --column Info`
#echo $display

# Map pointer to display to get initial coordinate transformation matrix
xinput map-to-output "$pointer" "$display"
mat0=`xinput list-props $pointer | grep "Coordinate Transformation Matrix" | cut -d ':' -f 2`

# Select orientation
o1="0°C"
o2="90°C"
o3="180°C"
o4="270°C"
orientation=`$ZENITY --list --text "Choose an orientation" --column Orientation --column Name "$o1" "Normal" "$o2" "Rotate left" "$o3" "Invert" "$o4" "Rotate right"`
# https://wiki.ubuntu.com/X/InputCoordinateTransformation
if [ "$orientation" = "$o1" ]; then
  mat1="1 0 0 0 1 0 0 0 1"
elif [ "$orientation" = "$o2" ]; then
  mat1="0 -1 1 1 0 0 0 0 1"
elif [ "$orientation" = "$o3" ]; then
  mat1="-1 0 1 0 -1 1 0 0 1"
else
  mat1="0 1 0 -1 0 1 0 0 1"
fi

# Multiply matrices (mat2 = mat0 * mat1)
# https://www.mymathtables.com/calculator/matrix/3-cross-3-matrix-multiplication.html
perl_expr="@a=split(/,? /,'$mat0');@b=split(/ /,'$mat1');print \"\"\
  .(\$a[0]*\$b[0]+\$a[1]*\$b[3]+\$a[2]*\$b[6]).\" \".(\$a[0]*\$b[1]+\$a[1]*\$b[4]+\$a[2]*\$b[7]).\" \".(\$a[0]*\$b[2]+\$a[1]*\$b[5]+\$a[2]*\$b[8]).\" \"\
  .(\$a[3]*\$b[0]+\$a[4]*\$b[3]+\$a[5]*\$b[6]).\" \".(\$a[3]*\$b[1]+\$a[4]*\$b[4]+\$a[5]*\$b[7]).\" \".(\$a[3]*\$b[2]+\$a[4]*\$b[5]+\$a[5]*\$b[8]).\" \"\
  .(\$a[6]*\$b[0]+\$a[7]*\$b[3]+\$a[8]*\$b[6]).\" \".(\$a[6]*\$b[1]+\$a[7]*\$b[4]+\$a[8]*\$b[7]).\" \".(\$a[6]*\$b[2]+\$a[7]*\$b[5]+\$a[8]*\$b[8]).\" \"\
  .\"\\n\""
#echo $perl_expr
mat2=`perl -E "$perl_expr"`

xinput set-prop "$pointer" --type=float "Coordinate Transformation Matrix" $mat2

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .