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 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 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 :)
I agree with @Cris however depending on your device you may end up having to tweak the coordinates a bit.
I ended up using:
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"
in the end :)
generally rotation in 22 can be restored by re-installing iio-sensor-proxy, youll notice when it is not working that systemctl outputs an errorin the end. By re-installing error disappears and rotation is restored.