[Others] 如何仅禁用鼠标中键的粘贴功能?
Tofloor
poster avatar
FinchXD
deepin
2022-12-04 06:25
Author

deepin 中鼠标中键默认有粘贴功能,但是在一些场景下该功能会带来一些困扰;例如在 figma 以及 mastergo 等设计软件中,鼠标中键经常用来拖动视窗,但是在 deepin 中在拖动的同时会多粘贴一下。

社区提到了通过 xmodmap 来禁用鼠标中键的解决方案,但是该解决方案并非仅禁用粘贴功能,而是会导致整个中键不可用。是否存在禁用粘贴功能的设置呢?

另外 ubuntu(可能是 gnome 都支持)中似乎是支持该设置的:https://linuxconfig.org/how-to-disable-middle-mouse-button-click-paste-on-ubuntu-20-04-focal-fossa-linux

image.png

Reply Favorite View the author
All Replies
wtz
deepin
2022-12-04 18:23
#1

https://bbs.deepin.org/post/228794

看看这个可行不。

Reply View the author
FinchXD
deepin
2022-12-04 20:03
#2
wtz

https://bbs.deepin.org/post/228794

看看这个可行不。

谢谢,不过试了下不行

Reply View the author
xuqi
deepin testing team
2022-12-05 01:32
#3

解决方案

1. 禁用中键功能,在终端输入如下命令即可:

禁用中键粘贴,开启侧键复制粘贴功能

xmodmap -e "pointer = 1 25 3 4 5 6 7 2"

仅禁用中键粘贴

xmodmap -e "pointer = 1 25 3 4 5 6 7 8"

2. 恢复中键功能

xmodmap -e "pointer = 1 2 3 4 5 6 7 8"

这里 xmodmap命令是在修改按键映射,我们应该知道,鼠标键盘按下时实际产生的是一个“信号”,至于这个信号要怎么处理,则由软件(含操作系统)去实现。
pointer表示鼠标,其后的参数是一串指令,其中前三个“1 2 3”就表示鼠标的“左 中 右”三个按键。

如果你习惯左手去操作鼠标,想把鼠标左右按键功能交换,就可以这么设置:

xmodmap -e "pointer = 3 2 1 4 5 6 7 8"
Reply View the author
xuqi
deepin testing team
2022-12-05 01:34
#4
Reply View the author
wtz
deepin
2022-12-05 03:12
#5
FinchXD

谢谢,不过试了下不行

那只能等官方解决方案了。

Reply View the author
FinchXD
deepin
2022-12-17 00:10
#6
xuqi

好的谢谢!晚点尝试一下

Reply View the author
FinchXD
deepin
2022-12-17 07:33
#7
xuqi

这个方案存在一些问题,会把所有中键点击的功能都禁用掉,包括 chrome 里打开新 tab/关闭 tab,以及 figma, mastergo 里面的中键拖动的功能

Reply View the author