Linux触摸板配置
Contents
Linux触摸板配置
libinput
libinput是一个函数库,在 Wayland 上用来接收设备的输入,在 X.Org 上提供输入设备的驱动。它提供对设备事件的检测和接收。对输入设备信号进行处理。它提供了一些列的函数供用户使用。
安装
Wayland下不需要手动安装Xorg下需要安装xf86-input-libinput,如果需要程序运行时改变配置,则需要安装xorg-xinput
配置
Wayland下没有libinput的配置文件,不同桌面具有不同的支持
Xorg默认配置文件位于/usr/share/X11/xorg.conf.d/40-libinput.conf中
Xorg应将自定义配置文件放到/etc/X11/xorg.conf.d/目录下,防止软件更新后覆盖了之前的配置文件
|
|
可以查看哪些设备被libinput支持,同时也可以使用以下命令
|
|
在40-libinput.conf中配置
|
|
- 配置文件中存在多个
Section时,需要配置Match*,这通常代表着过滤- MatchIsPointer “on” (trackpoint)
- MatchIsKeyboard “on”
- MatchIsTouchpad “on”
- MatchIsTouchscreen “on”
- 常用配置选项如下
- Option “Tapping” “on”: 触摸以点击
- Option “ClickMethod” “clickfinger”: 触摸板不再拥有中右键区域的区分,与之代替的是双指代表右键,三指代表中键。 详情请看docs.
- Option “NaturalScrolling” “on”: 自然滚动(反方向滚动)
- Option “ScrollMethod” “edge”: 边缘滚动页面
- Option “TappingButtonMap” “lrm”: 单指,两指,三指分别代表鼠标左,右,中的点击
30-touchpad.conf中配置
- 配置与上述一致,但只需配置一个
Section
触摸板手势
- 安装
libinput-gestures和xdotool wmctrl - 将当前用户添加到
input组里:sudo gpasswd -a $USER input - 拷贝配置文件到
XDG_CONFIG_HOME:cp /etc/libinput-gestures.conf ~/.config/ - 修改
libinput-gestures.conf配置文件格式为:gesture 动作 映射 - 动作如下
swipe up/down/left/right n:n指向上下左右滑动pin in/out n:n指捏张swipe right_up/right_down/left_up/left_down n:n指向右上,右下,左上,左下滑动pin clockwise/anticlockwise n:n指顺时针,逆时针转动
- 映射可使用
xdotool映射:xdotool key 按键,按键支持x keysym风格的字符串,可以通过xev获取
|
|
libinput-gestures-setup autostart后libinput-gestures-setup start启动