{{tag>Brouillon Matériel Xorg}}
= Notes écran tactile touch screen
Voir :
* [[Notes Systemd udev]]
* https://wiki.archlinux.org/index.php/touchscreen
* https://wiki.ubuntu.com/Touchscreen
* https://wiki.ubuntu.com/X/InputCoordinateTransformation
Pb écran tactile
apt-get install xinput-calibrator xinput
export DISPLAY=:0
ID=$(xinput list --id-only "eGalax Inc. USB TouchController")
SCREEN=$(xrandr 2>&1|grep -e ' connected primary' | awk '{print $1}')
#xinput --map-to-output 11 DVI-D-0
xinput --map-to-output $ID $SCREEN
xinput list-props "eGalax Inc. USB TouchController" |grep -e "Coordinate Transformation Matrix"
Coordinate Transformation Matrix (155): 0.000000, 0.375000, 0.000000, -1.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000
xinput_calibrator -v --device "eGalax Inc. USB TouchController"
https://askubuntu.com/questions/41385/cannot-calibrate-touchscreen
== Persistance
''/usr/local/bin/touchscreencfg.sh''
#! /bin/bash
export DISPLAY=:0
NAME=$(xinput list --name-only |grep -i -e touch | grep -iv -e ' pen')
ID=$(xinput list --id-only "$NAME")
SCREEN=$(xrandr 2>&1 |grep -e ' connected primary' |awk '{print $1}')
/usr/bin/xinput --map-to-output $ID $SCREEN
( sleep 5 ; /usr/bin/xinput --map-to-output $ID $SCREEN ) &
chmod +x /usr/local/bin/touchscreencfg.sh
''~/.xsessionrc''
/usr/local/bin/touchscreencfg.sh
== Pb
=== Pb persistance sur débranchement ou extinction de l'écran
Voir [[Notes Systemd udev]]
--------------------------------
== Notes en vrac - pb débranchement retranchement extinction écran - perte orientation touchscreen
Voir :
* https://learn.adafruit.com/adafruit-pitft-28-inch-resistive-touchscreen-display-raspberry-pi/touchscreen-install-and-calibrate
68.624] (II) NVIDIA(0): Setting mode "DVI-D-0: nvidia-auto-select @768x1024 +0+0 {ViewPortIn=768x1024, ViewPortOut=1024x768+0+0, Rotation=270}"
modprobe evdev
modprobe usbtouchscreen usbhid
cat /proc/bus/input/devices
echo Y > /sys/module/usbtouchscreen/parameters/swap_xy
Enable the Touchscreen in Lightdm (the login screen)
copy ~/.config/monitors.xml to /var/lib/lightdm/.config
xinput_calibrator --device "Elo Touch Solutions Elo Touch Solutions Pcap USB Interface" --output-type xorg.conf.d --no-timeout
Calibrating EVDEV driver for "Elo Touch Solutions Elo Touch Solutions Pcap USB Interface" id=8
current calibration values (from XInput): min_x=0, max_x=4095 and min_y=0, max_y=4095
Doing dynamic recalibration:
Setting calibration data: 1, 4064, -19, 4082
--> Making the calibration permanent <--
copy the snippet below into '/etc/X11/xorg.conf.d/99-calibration.conf' (/usr/share/X11/xorg.conf.d/ in some distro's)
Section "InputClass"
Identifier "calibration"
MatchProduct "Elo Touch Solutions Elo Touch Solutions Pcap USB Interface"
Option "Calibration" "1 4064 -19 4082"
Option "SwapAxes" "0"
EndSection
''/etc/X11/xorg.conf.d/99-calibration.conf''
Section "InputClass"
Identifier "calibration"
MatchProduct "Elo Touch Solutions Elo Touch Solutions Pcap USB Interface"
Option "Calibration" "44 4061 4081 -44"
Option "SwapAxes" "1"
Option "InvertX" "0"
Option "InvertY" "0"
EndSection
=== Matrix
https://gist.github.com/mildmojo/48e9025070a2ba40795c#file-rotate_desktop-sh-L41
https://github.com/swkim01/waveshare-dtoverlays
xinput list-props "Elo Touch Solutions Elo Touch Solutions Pcap USB Interface" |grep Matrix
Coordinate Transformation Matrix (155): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
Option "TransformationMatrix" "1 0 0 0 1 0 0 0 1"
=== Troubleshooting
sudo apt-get install -y evtest
== Notes
https://askubuntu.com/questions/253395/touchscreen-calibration-with-dual-monitors-nvidia-and-xinput
https://wiki.archlinux.org/index.php/Calibrating_Touchscreen
Do it automatically via a udev rule
Create a file something like ''/etc/udev/rules.d/99-acer-touch.rules'' with contents like this:
ENV{ID_VENDOR_ID}=="2149",ENV{ID_MODEL_ID}=="2703",ENV{WL_OUTPUT}="DVI1",ENV{LIBINPUT_CALIBRATION_MATRIX}="1 0 0 0 1 0"
LXQt
''~/.config/autostart/lxqt-config-touchpad-autostart.desktop''
[Desktop Entry]
Comment=Autostart touchpad settings for lxqt-config-input
Exec=lxqt-config-input --load-touchpad
Name=lxqt-config-touchpad-autostart
OnlyShowIn=LXQt
Type=Application
Version=1.0