解决Ubuntu 20.04在Thinkpad上的鼠标中键的粘贴问题

在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时间后就是滚轮功能了。

https://mos86.com/58725.html
https://yujian5.wordpress.com/2008/09/26/%E5%8F%96%E6%B6%88linux%E4%B8%8B%E7%9A%84%E9%BC%A0%E6%A0%87%E4%B8%AD%E9%94%AE%E7%B2%98%E8%B4%B4%E5%8A%9F%E8%83%BD/

© 版权声明
THE END
如果内容对您有所帮助,就支持一下吧!
点赞0 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容