在Linux下按鼠标中键是粘贴功能,使用一般的鼠标问题不大,因为中键功能及滚轮功能是分开的,但在TP上使用小红点及触摸板中键来滚动页面,就来问题了,特别是查看文本时一按中键就是粘贴,这肯定是不想要的。
一般解决方案是使用xmodmap,修改中键功能映射,禁用中键。
echo"pointer = 1 6 3 5 4 2" > ~/.Xmodmap && xmodmap ~/.Xmodmap
虽然使用xmodmap是解决了TP的小红点滚动问题,可是中键就完全没作用了,TP中键最好用的用法是,在firefox中用以新页面打开链接,小红点加中键打开新页和滚动浏览流畅得很,手指基本不用移动。
所以比较好解决问题的方法,是通过修改Xorg.conf文件。
打开/usr/share/X11/xorg.conf.d/40-libinput.conf, 增加option部分。
Section "InputClass"
Identifier "libinput pointer catchall"
MatchIsPointer "on"
MatchDevicePath "/dev/input/event*"
Option "EmulateWheel" "true"
Option "EmulateWheelButton" "2"
Option "EmulateWheelTimeout" "1"
Driver "libinput"
EndSection
这3个选项把中键的timeout时间设成了1ms,在1ms之内快速按下并松开中键的话,依然还是粘贴功能, 过了1ms时间后就是滚轮功能了。