You are not logged in.

#1 2018-04-18 07:51:09

croquagei
Member
Registered: 2013-10-03
Posts: 5

Disabling Middle click paste completely

Hi everyone.  I want to disable middle click paste, I'm on a touchpad that registers a middle click if i tap near the bottom in the middle and it's driving me nuts when i'm scrolling around my text editor and it pastes out of nowhere. 

I use Gnome shell. 

I have it disabled in Tweak Tool.  That did absolutely nothing

I have disabled it in dconf (not sure why tweak tool isn't doing that!). That disabled it for all Gnome applications - eg Geddit.

However the behavior still remains for the things I most need to disable it for.  Primarily my text editor. 

I want to just remove it, completely.  I don't want to disable middle click as i often use it to open new tabs in my web browser.

Offline

#2 2018-04-18 10:43:45

NoSuck
Member
Registered: 2015-03-04
Posts: 157
Website

Re: Disabling Middle click paste completely

Have you tried xmodmap?  Have you considered changing the "Mouse Click Emulation" setting of Tweak Tool to "Fingers" (or even "Disabled")?

Offline

#3 2018-04-18 11:50:29

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,410

Re: Disabling Middle click paste completely

Also what is "your text editor"? If your GNOME is on Wayland but your text editor not you might have to do more specific configuration for the XWayland window if possible.

Offline

#4 2018-04-18 13:39:43

seth
Member
Registered: 2012-09-03
Posts: 49,951

Re: Disabling Middle click paste completely

Short answer: you can't. The middle-click interpretation is up to the client, the majority of clients will use it for pasting if that makes sense in the clicked area.
You can disable the button, but not generally impact its behavior. This needs a per-client setting (iff available)
https://wiki.archlinux.org/index.php/Cl … ouse_click

I'd focus on altering the touchpad behavior, eg. usually the middle click is emulated by clicking left+right button together and then disable the tapping behavior.

Offline

#5 2018-04-21 03:31:35

croquagei
Member
Registered: 2013-10-03
Posts: 5

Re: Disabling Middle click paste completely

Thanks for all your replies. 

I'd rather not disable middle click as i use it when web browsing.

Thankfully I found a way to disable it in my editor Visual Studio code by adding this line to the settings json file.

"editor.selectionClipboard": false,

Last edited by croquagei (2018-04-21 03:31:53)

Offline

#6 2018-11-23 14:46:01

digitalone
Member
Registered: 2011-08-19
Posts: 328

Re: Disabling Middle click paste completely

It can be disabled, at least in Plasma applications using the following workaround.

Install xsel and sxhkdrc.

Place the following in ~/.config/sxhkd/sxhkdrc:

~button2
    echo -n | xsel -n -i
~control + c
    echo -n | xsel -n -i 

Let sxhkdrc execute during Plasma 5 startup.

It can still work in non-KDE applications, but depending on the application it can be disabled, i.e. there's a specific option for Firefox and in Chromium you can install AutoScroll extention to remap middle-click button to automatically scroll the page that's more useful than pasting.

Cheers.

Offline

Board footer

Powered by FluxBB