From ede73619ea7c4a319dc15d1b4b7234bbc66f61e0 Mon Sep 17 00:00:00 2001 From: Jordan Date: Sun, 20 Jun 2021 20:27:07 -0400 Subject: [PATCH] docs: Touchscreen rotation configuration --- docs/Installation.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/docs/Installation.md b/docs/Installation.md index a6b68c82..bc40bcc6 100644 --- a/docs/Installation.md +++ b/docs/Installation.md @@ -69,3 +69,40 @@ Find the ID of your display and put it in the following command: ``` DISPLAY=:0 xinput_calibrator -v --device ``` + +#### Touchscreen touch rotation +If your touchscreen isn't registering touches properly after the screen has been rotated, you will need to apply a +transformation matrix. You can have the matrix be one of the following: +0°: `1 0 0 0 1 0 0 0 1` +90° Clockwise: `0 -1 1 1 0 0 0 0 1` +90° Counter-Clockwise: `0 1 0 -1 0 1 0 0 1` +180°: `-1 0 1 0 -1 1 0 0 1` + +To check the current matrix, you will need your `` (which can be found via the last section, ex: +"wch.cn USB2IIC_CTP_CONTROL"). Run the following command: +`xinput list-props "wch.cn USB2IIC_CTP_CONTROL"` + +It will output something such as: +``` +Device '': + Device Enabled (115): 1 + Coordinate Transformation Matrix (116): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000 + libinput Calibration Matrix (247): -1.000000, 0.000000, 1.000000, 0.000000, -1.000000, 1.000000, 0.000000, 0.000000, 1.000000 + libinput Calibration Matrix Default (248): -1.000000, 0.000000, 1.000000, 0.000000, -1.000000, 1.000000, 0.000000, 0.000000, 1.000000 + libinput Send Events Modes Available (249): 1, 0 + libinput Send Events Mode Enabled (250): 0, 0 + libinput Send Events Mode Enabled Default (251): 0, 0 + Device Node (252): "/dev/input/event0" + Device Product ID (253): 6790, 58083 +``` + +You can verify by checking that the 'Coordinate Transformation Matrix' or 'libinput Calibration Matrix'. + +You can test a change by running: +`xinput set-props "" 'Coordinate Transformation Matrix' ` +Replace matrix with one of the options above, such as: `1 0 0 0 1 0 0 0 1` + +To make this permanent, modify the file `/etc/udev/rules.d/51-touchscreen.rules` and put the following line in: +``` +ACTION=="add", ATTRS{name}=="", ENV{LIBINPUT_CALIBRATION_MATRIX}="" +```