Resolved: 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?


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:
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"
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 🙂

If you have better answer, please add a comment about this, thank you!