Linux触摸板设置

Linux触摸板设置(archlinux)

官方文档:https://wiki.archlinux.org/index.php/Libinput
libinput官方手册:https://www.mankier.com/4/libinput

安装

推荐使用 libinput,因为 synaptics 不再维护了。
在Xorg上安装libinput,使用xf86-input-libinput包。

# pacman -S libinput xf86-input-libinput
libinput配置文件位置

1.libinput默认的配置文件在/usr/share/X11/xorg.conf.d/40-libinput.conf,可以设置鼠标加速、额外的鼠标按键、触控板、触控屏等。
2.由于同一个设备的不同驱动程序可以共存,如果你打算为一个设备使用 libinput 驱动,请确保它在其他驱动中 /etc/X11/xorg.conf.d/ 拥有优先级。
举个栗子:
如果你同时安装了 libinput 和 synaptics 并使用其默认配置(即 /etc/X11/xorg.conf.d/ 中没有属于两者中任一的文件),synaptics 将因其在默认安装目录中拥有更高的数字顺序 70- 而获得优先级。为了避免这种情况,您可以将默认的 libinput 配置文件(40-libinput.conf)软链接到目录搜索顺序优先于 70-synaptics.conf 的 /etc/X11/xorg.conf.d/ 中去取代它。

# ln -s /usr/share/X11/xorg.conf.d/40-libinput.conf /etc/X11/xorg.conf.d/40-libinput.conf
xinput命令

xinput 主要用于管理电脑上的输入设备。
1.查看帮助xinput -h
2.查看 Xorg 的所有输入设备xinput list
(list 参数后面可以跟–short,–long,–name-only,–id-only等参数)

# xinput list
⎡ Virtual core pointer                    	id=2	[master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer              	id=4	[slave  pointer  (2)]
⎜   ↳ SynPS/2 Synaptics TouchPad              	id=12	[slave  pointer  (2)]
⎜   ↳ TPPS/2 IBM TrackPoint                   	id=13	[slave  pointer  (2)]
⎣ Virtual core keyboard                   	id=3	[master keyboard (2)]
    ↳ Virtual core XTEST keyboard             	id=5	[slave  keyboard (3)]
    ↳ Power Button                            	id=6	[slave  keyboard (3)]
    ↳ Video Bus                               	id=7	[slave  keyboard (3)]
    ↳ Video Bus                               	id=8	[slave  keyboard (3)]
    ↳ Sleep Button                            	id=9	[slave  keyboard (3)]
    ↳ Integrated Camera                       	id=10	[slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard            	id=11	[slave  keyboard (3)]
    ↳ ThinkPad Extra Buttons                  	id=14	[slave  keyboard (3)]

3.根据设备ID查看设备的属性信息

# xinput list-props 12        # 查看 id=12 的设备状态
Device '    Touchpad':
        Device Enabled (167):   1
        Coordinate Transformation Matrix (169): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
        libinput Tapping Enabled (320): 1
        libinput Tapping Enabled Default (321): 0
        libinput Tapping Drag Enabled (322):    1
        libinput Tapping Drag Enabled Default (323):    1
        libinput Tapping Drag Lock Enabled (324):       0
        libinput Tapping Drag Lock Enabled Default (325):       0
        libinput Tapping Button Mapping Enabled (326):  1, 0
        libinput Tapping Button Mapping Default (327):  1, 0
        libinput Natural Scrolling Enabled (302):       0
        libinput Natural Scrolling Enabled Default (303):       0
        libinput Disable While Typing Enabled (328):    1
        libinput Disable While Typing Enabled Default (329):    1
        libinput Scroll Methods Available (304):        1, 1, 0
        libinput Scroll Method Enabled (305):   1, 0, 0
        libinput Scroll Method Enabled Default (306):   1, 0, 0
        libinput Click Methods Available (330): 1, 1
        libinput Click Method Enabled (331):    0, 1
        libinput Click Method Enabled Default (332):    1, 0
        libinput Middle Emulation Enabled (333):        0
        libinput Middle Emulation Enabled Default (334):        0
        libinput Accel Speed (311):     0.000000
        libinput Accel Speed Default (312):     0.000000
        libinput Accel Profiles Available (313):        1, 1
        libinput Accel Profile Enabled (314):   1, 0
        libinput Accel Profile Enabled Default (315):   1, 0
        libinput Left Handed Enabled (316):     0
        libinput Left Handed Enabled Default (317):     0
        libinput Send Events Modes Available (287):     1, 1
        libinput Send Events Mode Enabled (288):        0, 0
        libinput Send Events Mode Enabled Default (289):        0, 0
        Device Node (290):      "/dev/input/event8"
        Device Product ID (291):        1739, 10608
        libinput Drag Lock Buttons (318):       <no items>
        libinput Horizontal Scroll Enabled (319):

Device Enabled (167): 1
Device Enabled 是属性名,括号中的 167 是属性ID,1/0 表示启用/禁用

4.根据属性ID设置属性
xinput set-prop <device> [--type=atom|float|int] [--format=8|16|32] <property> <val> [<val>...]

# xinput set-prop 12 167 1
# xinput set-prop 14 303 {1 1}

5.根据设备ID启用设备

# xinput enable 12
更改libinput配置
# vim /etc/X11/xorg.conf.d/40-libinput.conf

MatchIsPointer “on” # 小红点
MatchIsKeyboard “on” # 软键盘
MatchIsTouchpad “on” # 触控板
MatchIsTouchscreen “on” # 触控屏

常用选项
1.当检测到 USB 鼠标时,它将禁用触摸板。
Option "SendEventsMode" "disabled-on-external-mouse"
2.允许单指和双指触击分别调用鼠标左右键,而不用按触控板的物理按键
Option "Tapping" "True"
3.防止打字时误触触控板
Option "DisableWhileTyping" "True"
4.触摸板不再拥有区域的区分,与之代替的是双指代表右键,三指代表中键。
Option "ClickMethod" "clickfinger"
5.轻击后手指按住会使单个按钮关闭,此手指的所有动作都将转换为拖动动作。
Option "TappingDrag" "True"
6.自然滚动(反方向滚动)
Option "NaturalScrolling" "True"
7.启用鼠标加速配置文件。这有助于使鼠标手指的速度更自然一些,迟钝感更小。建议使用 Adaptive,因为其会根据您的输入更改。您也可以尝试“flat”选项。
Option "AccelProfile" "adaptive"
8.更改鼠标指针的加速速度。使用 -1 到 1 之间的值。数值越大,指针移动的速度越高。大多数人倾向于使用 0.2 以获得较慢的响应速度,使用 0.5 获得较快的响应速度。
Option "AccelSpeed" "0.3"

按键映射
手势操作
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值