在 Xubuntu 18.04 中,我尝试将校准参数应用于触摸屏但没有成功。这是我到目前为止...
我可以手动连接设备并执行如下校准:
$ sudo /usr/bin/inputattach --daemon --always -elo /dev/ttyS2
$ xinput set-int-prop "Elo Serial TouchScreen" "Evdev Axis Calibration" 32 0 4095 0 4095
$ xinput_calibrator --output-type xinput
$ xinput set-int-prop "Elo Serial TouchScreen" "Evdev Axis Calibration" 32 -97 4087 -48 4108
但是我设置的新参数没有效果,即使xinput
列出了更新的值。我找到的所有信息都相当陈旧。有人建议evdev
应该使用它来代替libinput
(稍后会详细介绍),但它无法安装。
这是我在图形服务器配置中自动附加输入和处理校准的操作:
$ cat /etc/udev/rules.d/99-elographics.rules
ACTION=="add|change", SUBSYSTEM=="tty|pnp", KERNEL=="ttyS2", TAG+="systemd", ENV{SYSTEMD_WANTS}+="elo-inputattach@%k.service"
$ cat /etc/systemd/system/[email protected]
[Unit]
Description=inputattach for elo serial devices
[Service]
Type=simple
ExecStart=/usr/bin/inputattach -elo /dev/%I
$ cat /usr/share/X11/xorg.conf.d/99-calibration.conf
Section "InputClass"
Identifier "calibration"
MatchProduct "Elo Serial TouchScreen"
Option "MinX" "-1587"
Option "MaxX" "66954"
Option "MinY" "-690"
Option "MaxY" "67633"
Option "SwapXY" "0" # unless it was already set to 1
Option "InvertX" "0" # unless it was already set
Option "InvertY" "0" # unless it was already set
EndSection
在 99-calibration.conf 我尝试了各种选项,例如
Option "Calibration" "-97 4087 -48 4108"
我还尝试evdev
在该部分中将驱动程序设置为,但它恢复为libinput
.
以下是 /var/log/Xorg.0.log 的摘录:
[ 1446.102] (II) config/udev: Adding input device Elo Serial TouchScreen (/dev/input/event15)
[ 1446.102] (**) Elo Serial TouchScreen: Applying InputClass "libinput touchscreen catchall"
[ 1446.102] (**) Elo Serial TouchScreen: Applying InputClass "calibration"
[ 1446.102] (II) Using input driver 'libinput' for 'Elo Serial TouchScreen'
[ 1446.102] (**) Elo Serial TouchScreen: always reports core events
[ 1446.102] (**) Option "Device" "/dev/input/event15"
[ 1446.102] (**) Option "_source" "server/udev"
[ 1446.103] (II) event15 - Elo Serial TouchScreen: is tagged by udev as: Touchscreen
[ 1446.103] (II) event15 - Elo Serial TouchScreen: device is a touch device
[ 1446.103] (II) event15 - Elo Serial TouchScreen: device removed
[ 1446.135] (**) Option "config_info" "udev:/sys/devices/pnp0/00:08/tty/ttyS2/serio1/input/input7/event15"
[ 1446.135] (II) XINPUT: Adding extended input device "Elo Serial TouchScreen" (type: TOUCHSCREEN, id 13)
[ 1446.135] (**) Option "AccelerationScheme" "none"
[ 1446.135] (**) Elo Serial TouchScreen: (accel) selected scheme none/0
[ 1446.135] (**) Elo Serial TouchScreen: (accel) acceleration factor: 2.000
[ 1446.135] (**) Elo Serial TouchScreen: (accel) acceleration threshold: 4
[ 1446.136] (II) event15 - Elo Serial TouchScreen: is tagged by udev as: Touchscreen
[ 1446.136] (II) event15 - Elo Serial TouchScreen: device is a touch device
[ 1446.137] (II) config/udev: Adding input device Elo Serial TouchScreen (/dev/input/mouse1)
[ 1446.137] (**) Elo Serial TouchScreen: Applying InputClass "calibration"
[ 1446.137] (II) No input driver specified, ignoring this device.
[ 1446.137] (II) This device may have been added with another device file.