解决Linux下的触控板问题

本文最后更新于 2023年12月19日 晚上

触控板问题

安装ArchLinux的时候,出现了触控板问题。那肯定是去查archwiki

解决篇

我用的是Xorg

必要的包

安装libinput。Xorg还需要安装xf86-input-libinput。还可能需要安装xorg-xinput来调整设置。

不论用的是Wayland还是Xorg,libinput应该都已经安装了。

调整设置

首先查看当前用户是否在input这个用户组里。执行groups | grep "input"显示用户所在组,不在组里没权限改设置。不在组里就加一下。

1
sudo usermod -aG input Your_username

另种改设置的方法: 1. 用xinput 2. 编辑配置文件

xinput

可以阅读ArchLinux wiki上有关xinput的页面了解。

查看可用设备

1
xinput list

查看设备的设置

1
xinput list-props your_device

这里可以用设备id或者设备名

调节设置

1
xinput set-prop yout_device property_you_want your_values

配置文件

详见ArchLinux wiki

自定义配置文件应该是/etc/X11/xorg.conf.d/30-touchpad.conf。要添加触控板的相关设置,首先要找到配置文件中和触控板有关部门的项。我这里是这样的

1
2
3
4
5
6
7
8
...
Section "InputClass"
Identifier "libinput touchpad catchall"
MatchIsTouchpad "on"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
EndSection
...

在下面添加配置,具体的配置项可以看这里。以下是我习惯的配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
...
Section "InputClass"
Identifier "libinput touchpad catchall"
MatchIsTouchpad "on"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
Option "AccelProfile" "0.5"
Option "DisableWhileTyping" "true"
Option "NaturalScrolling" "true"
Option "ScrollMethod" "twofinger"
Option "Tapping" "true"
Option "TappingButtonMap" "1/2/3"
Option "TappingDrag" "true"

EndSection
...

更改完之后保存重启,发现触控板设置正常。


解决Linux下的触控板问题
https://www.appe.moe/2023/05/01/解决Linux下的触控板问题/
作者
APPE
发布于
2023年5月1日
许可协议