Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Portrait screen touch vertical rotation on Ubuntu 20.04 doesn't work

I have an ubuntu 20.04 system, so if I change my screen to portrait vertical, touch doesn't work well. It seems to be X and Y inverted.

Does anybody know what's happening?

like image 493
Cris Avatar asked Oct 23 '25 15:10

Cris


1 Answers

I found the solution! You have to rotate the Calibration Matrix with udev rules.

Look for the touch screen here:

cat /proc/bus/input/devices

And see which event is using. Then...

udevadm info -a -p /sys/class/input/event6 | grep name

This will return something like this:

ATTRS{name}=="Multi touch...."

Copy this line and:

sudo vim /etc/udev/rules.d/99-calibration.rules

Add this line there for left rotation screen:

ATTRS{name}=="Multi touch....", ENV{LIBINPUT_CALIBRATION_MATRIX}="0.000000 1.000000 0.000000 -1.000000 0.000000 1.000000 0.000000 0.000000 1.000000"

Instead, add this line there for right rotation screen:

ATTRS{name}=="Multi touch....", ENV{LIBINPUT_CALIBRATION_MATRIX}="0.000000 -1.000000 1.000000 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000"

Then, reboot your system, or if you prefer, restart services:

sudo udevadm control --reload-rules
sudo udevadm trigger
sudo service udev restart

By this way, you will have your touch screen working on vertical or portrait mode, and touch mode works.

After 98837458 tests, this is the only solution I found in order to change the landscape screen to portrait screen and make the touch works.

If you need a landscape screen again, you have to delete this file (99-calibration.rules) and reboot or restart services.

Wish this helps you :)

like image 58
Cris Avatar answered Oct 27 '25 05:10

Cris