Page 1 of 1
How to disable Middle-Mouse-wheel Click to Paste (XFCE)
Posted: Thu Nov 12, 2020 7:22 pm
by remoteone
This is apparently a problem that has been around in linux for decades.
The problem is that most mice these days have sensitive mouse wheel button action.
Thats great for most things , except click-to-paste. I know Im not alone with this issue as there are thousands of requests over the web for a simple way to disable this.
Im not changing my expensive G304 mouse to one with a heavier action after finally finding one that has high enough DPI to work productively on a 4K display.
The problem is with accidental pastes when writing article, emails etc. Imagine your username or password mistakenly being pasted into an email:
This issue
- Big SECURITY RISK
- Poor Productivity, having to manually check and re-check articles before sending/publishing.
- Random pastes completely stuffing php/html coding.
I could not find a setting in the Settings Editor or other Mouse/Touchpad settings managers.
My last resort may be to dismantle the mouse to try and make the click tension heavier.
Is there a way to disable JUST the Click to Paste "feature" of the Middle-Mouse-wheel in MXL xfce?
Re: How to disable Middle-Mouse-wheel Click to Paste (XFCE)
Posted: Thu Nov 12, 2020 7:43 pm
by JayM
A web search comes up with many, many sites with solutions for disabling only the click-to-paste mouse wheel function in Linux. Try it.
Re: How to disable Middle-Mouse-wheel Click to Paste (XFCE)
Posted: Thu Nov 12, 2020 8:11 pm
by remoteone
Thank you for your suggestion Jay,
After I tried one, that did nothing, decided to reach out to a more direct approach...the forum.
Most "solutions" describe known bugs associated with clipboard managers, or are for Gnome or other platforms. I was hoping for a specific solution for Debian/Xfce to prevent wasting my life testing this-and-that possible application for days on end!
This is a productivity issue... and Ive got work to do!solution
Crazy that in the end I may need to mechanically modify the mouse to solve an obvious security risk.
Re: How to disable Middle-Mouse-wheel Click to Paste (XFCE)
Posted: Thu Nov 12, 2020 8:18 pm
by remoteone
Well, of some help is the config setting in Mozilla FF and Thunderbird for middlemouse.paste
Still need this OS wide for coding etc. but its a start.
Re: How to disable Middle-Mouse-wheel Click to Paste (XFCE)
Posted: Thu Nov 12, 2020 9:09 pm
by JayM
https://linuxconfig.org/how-to-disable- ... ossa-linux
Install the gnome-tweaks package, open a terminal and run
and follow the instructions on that website. I found this by searching Duckduckgo for the text of the subject of your post. Since Xfce is GTK-based it should work even though the instructions are for Gnome.
Re: How to disable Middle-Mouse-wheel Click to Paste (XFCE)
Posted: Thu Nov 12, 2020 11:14 pm
by remoteone
Thanks JayM, that seems to have worked, I'll test further to see if it stuffs anything else.
I did find that page with a Startpage search, but am so used to getting failures/bugs of non-GTK-based apps that didnt want to risk it.
Mind you the list of errors that pop up in terminal are a worry:
Code: Select all
WARNING : Shell not installed or running
WARNING : Error loading desktopfile: ~/.config/autostart/gnome-keyring-secrets.desktop
WARNING : Error loading desktopfile: ~/.config/autostart/copyq.desktop
WARNING : Error loading desktopfile: ~/.config/autostart/blueman.desktop
WARNING : Error loading desktopfile: ~/.config/autostart/xfce4-volumed.desktop
WARNING : Shell not running
NoneType: None
WARNING : Error detecting shell
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/gtweak/tweaks/tweak_group_shell_extensions.py", line 217, in __init__
raise Exception("Shell not running or DBus service not available")
Exception: Shell not running or DBus service not available
(gnome-tweaks:7999): Gtk-WARNING **: 14:30:31.380: gtk_window_present_with_time() should not be called with 0, or GDK_CURRENT_TIME as a timestamp, the timestamp should instead be gathered at the time the user initiated the request for the window to be shown
(gnome-tweaks:7999): GLib-GIO-CRITICAL **: 14:30:31.391: g_dbus_proxy_new: assertion 'G_IS_DBUS_CONNECTION (connection)' failed
(repeated ~11 times )
Re: How to disable Middle-Mouse-wheel Click to Paste (XFCE)
Posted: Fri Nov 13, 2020 12:53 am
by metreo
Disabling middle-click is something I would expect find as a white check-box in the Terminal Settings manager.
Re: How to disable Middle-Mouse-wheel Click to Paste (XFCE)
Posted: Fri Nov 13, 2020 1:33 am
by JayM
metreo wrote: Fri Nov 13, 2020 12:53 am
Disabling middle-click is something I would expect find as a white check-box in the Terminal Settings manager.
MX/Xfce doesn't have a terminal settings manager. There's Preferences within the Xfce4 Terminal if that's what you mean but I don't know why you'd expect to find global mouse configuration settings there.
Re: How to disable Middle-Mouse-wheel Click to Paste (XFCE)
Posted: Fri Nov 13, 2020 5:22 am
by remoteone
Update Re: gnome-tweaks - did not fix the issue for gtk3 apps
Re: How to disable Middle-Mouse-wheel Click to Paste (XFCE)
Posted: Fri Nov 13, 2020 3:28 pm
by fehlix
remoteone wrote: Thu Nov 12, 2020 7:22 pm
Is there a way to disable JUST the Click to Paste "feature" of the Middle-Mouse-wheel in MXL xfce?
Please post the output of this command running from terminal command line:
You will get something like this as shown on my pc:
Code: Select all
xinput --list
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ Logitech USB Laser Mouse id=11 [slave pointer (2)]
⎜ ↳ X10 WTI RF receiver mouse id=12 [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)]
↳ Power Button id=7 [slave keyboard (3)]
↳ USB Keyboard id=8 [slave keyboard (3)]
↳ USB Keyboard System Control id=9 [slave keyboard (3)]
↳ USB Keyboard Consumer Control id=10 [slave keyboard (3)]
↳ X10 WTI RF receiver id=13 [slave keyboard (3)]
↳ ACPI Virtual Keyboard Device id=14 [slave keyboard (3)]
My mouse has id=11
Now I can get the mouse buttons order this way:
Code: Select all
xinput --list 11 | egrep 'Buttons? '
where I got:
Code: Select all
xinput --list 11 | egrep 'Buttons? '
Buttons supported: 16
Button labels: "Button Left" "Button Middle" "Button Right" "Button Wheel Up" "Button Wheel Down" "Button Horiz Wheel Left" "Button Horiz Wheel Right" "Button Side" "Button Extra" "Button Forward" "Button Back" "Button Task" "Button Unknown" "Button Unknown" "Button Unknown" "Button Unknown"
Please post the output of those command mentioned and we can adjust it to construct a command running e.g at login or bound to a keyboard shortcut dis disable / enable middle-click.
Re: How to disable Middle-Mouse-wheel Click to Paste (XFCE)
Posted: Fri Nov 13, 2020 7:11 pm
by remoteone
Thank you for the assistance. I
At this stage, I should point out my opinion that the middle-wheel click-to-paste function can be an asset and a liability.
An asset when you actually WANT to just paste to an input box... but a DISASTER to productivity when accidental clicks occur.
Thus, an OS-wide solution isn't really the best solution. Since discovering that FireFox and Thunderbird have the setting to disable this, surely its technically possible for this to be disabled at app level, if the authors would implement.
At the risk of getting a bit off-topic...
What I really need now is a good code editor that also has this "disable-middle-click-paste" preference... alas, Geany and Bluefish dont seem to have this ability.
Code: Select all
xinput --list
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ Logitech G304 id=11 [slave pointer (2)]
⎜ ↳ DLL07BF:01 06CB:7A13 Mouse id=13 [slave pointer (2)]
⎜ ↳ DLL07BF:01 06CB:7A13 Touchpad id=14 [slave pointer (2)]
Code: Select all
xinput --list 11 | egrep 'Buttons? '
Buttons supported: 24
Button labels: "Button Left" "Button Middle" "Button Right" "Button Wheel Up" "Button Wheel Down" "Button Horiz Wheel Left" "Button Horiz Wheel Right" "Button Side" "Button Extra" "Button Forward" "Button Back" "Button Task" "Button Unknown" "Button Unknown" "Button Unknown" "Button Unknown" "Button Unknown" "Button Unknown" "Button Unknown" "Button Unknown" "Button Unknown" "Button Unknown" "Button Unknown" "Button Unknown"
Button state:
Re: How to disable Middle-Mouse-wheel Click to Paste (XFCE)
Posted: Fri Nov 13, 2020 7:14 pm
by remoteone
I found that there is an atom-disable-middle-click-paste extension for the Atom editor.
Re: How to disable Middle-Mouse-wheel Click to Paste (XFCE)
Posted: Fri Nov 13, 2020 8:01 pm
by fehlix
remoteone wrote: Fri Nov 13, 2020 7:11 pm
Code: Select all
xinput --list
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Logitech G304 id=11 [slave pointer (2)]
Code: Select all
xinput --list 11 | egrep 'Buttons? '
Buttons supported: 24
Button labels: "Button Left" "Button Middle" "Button Right" "Button Wheel Up" "Button Wheel Down" "Button Horiz Wheel Left" "Button Horiz Wheel Right" "Button Side" "Button Extra" "Button Forward" "Button Back" "Button Task" "Button Unknown" "Button Unknown" "Button Unknown" "Button Unknown" "Button Unknown" "Button Unknown" "Button Unknown" "Button Unknown" "Button Unknown" "Button Unknown" "Button Unknown" "Button Unknown"
Button state:
OK, a bash one liner:
To switch middle click off: ( SWITCH=0 ):
Code: Select all
bash -c 'SWITCH=0; M="Logitech G304"; MID=$(xinput --list --short | grep -oP "$M.*id=\K\d+"); BN=$(xinput --list $MID | grep -oP "Buttons supported: \K\d+"); P="xinput set-button-map $MID $(for i in $(eval echo {1..$BN}); do ((i==2)) && ((SWITCH==0)) && echo 0 || echo $i; done)"; echo $P; $P'
To switch middle click on: ( SWITCH=1 ):
Code: Select all
bash -c 'SWITCH=1; M="Logitech G304"; MID=$(xinput --list --short | grep -oP "$M.*id=\K\d+"); BN=$(xinput --list $MID | grep -oP "Buttons supported: \K\d+"); P="xinput set-button-map $MID $(for i in $(eval echo {1..$BN}); do ((i==2)) && ((SWITCH==0)) && echo 0 || echo $i; done)"; echo $P; $P'
You can bind it to keyboard shortcuts for enabling or disabling.
HTH

EDIT: adjusted to a slightly shorter variant
Re: How to disable Middle-Mouse-wheel Click to Paste (XFCE)
Posted: Fri Nov 13, 2020 8:41 pm
by i_ri
Hello remoteone
Sympathetic tone, touchpad did it to me last week.
Scrolling to make some changes in a config file
the touchpad must have taken some of the scrolls as paste (suspected middle-click).
scrolling quickly I missed seeing it happen; ensuing error to pursue.
never had a problem with mousewheel.
This certain touchpad is the first culprit to paste on middle-click unexpectedly.
Re: How to disable Middle-Mouse-wheel Click to Paste (XFCE)
Posted: Sat Nov 14, 2020 1:37 am
by JayM
The thing with many text editors and IDEs is that they're QT apps so the Gnome Tweak Tools mouse settings has no effect on them, but supposedly Geany is GTK-based so it should respect your GTK (Gnome) settings. Otherwise do as fehlix suggested to globally disable middle button click-to-paste everywhere on your system. Or just continue using Atom editor if you prefer, in which case please edit your post #1 and add "[SOLVED]" to the subject.
Re: How to disable Middle-Mouse-wheel Click to Paste (XFCE)
Posted: Thu Nov 26, 2020 7:22 am
by remoteone
So the bigger issue turns out to be the default linux "feature" referred to as copy-selection-to-clipboard.
This should be disabled by un-checking Clipman's [Sync selections] . But changing this has no effect at all.
Is there a Property that can be added to Settings Editor (or other) > xfce4 > plugins > ... to turn off copy-selection-to-clipboard
This so-called feature is an annoying hangover for when linux was all command line. Great for Terminal, but a productivity killer and security risk for desktop apps.
New topic needed for this no doubt.
Re: How to disable Middle-Mouse-wheel Click to Paste (XFCE)
Posted: Thu Nov 26, 2020 7:36 am
by Huckleberry Finn
Maybe doing the reverse
of this works: ( Option "Emulate3Buttons" "off" )
Edit: It seems you already solved that, anyway,
Radivarig's suggestion here seems to have worked for many people - also referenced from other sites - .
Re: How to disable Middle-Mouse-wheel Click to Paste (XFCE)
Posted: Thu Nov 26, 2020 5:27 pm
by fehlix
Toggle Middle Click Desktop Icon
I've seen different proposals. Here my latest.
toggle-middle-click.desktop
Code: Select all
[Desktop Entry]
# filename: toggle-middle-click.desktop
# MX-Forum: https://forum.mxlinux.org/viewtopic.php?p=609993#p609993
# fehlix , 26.11.2020
Version=1.0
Type=Application
Name=Toggle Middle Click
Comment=Switch middle click on/off
Exec=bash -c 'P=($(xmodmap -pp|grep -oP '[0-9]+$'));S=${P[1]};P[1]=${P[-1]};P[-1]=$S; MM="pointer = ${P[*]}"; X="xmodmap -e \\"$MM\\""; echo $X; XM=~/.Xmodmap; touch $XM; sed -i "/^[[:space:]]*pointer[[:space:]]*=/d" $XM ; echo $MM >> $XM; eval $X; STATE=OFF; ((P[1]==2)) && STATE=ON; notify-send --icon=input-mouse "Middle Click $STATE"'
#Icon=input-mouse-wheel
Icon=input-mouse
Path=
Terminal=false
StartupNotify=false
Categories=XFCE;GTK;Settings;DesktopSettings;X-XFCE-SettingsDialog;X-XFCE-HardwareSettings;
Copy and paste the content into a new text file and name it "toggle-middle-click.desktop".
Clicking on the desktop icon will switch on/off the mouse middle click.
It stays sticky after reboot or logout and login.
You can also copy the desktop-file into the folder ~/.local/share/applications
so it will be available within the menu.
HTH

[Solved] How to disable Middle-Mouse-wheel Click to Paste (XFCE)
Posted: Sat Dec 05, 2020 1:28 am
by remoteone
I have found my problem.. something to watch out for with linux (or maybe just xfce.. dunno)
So.. the issue really is that all text selected by double-click was being copied to Clipman manager list, even though
Sync-selection setting of
Clipman was unchecked.
Turns out that the title for this post should be different.
I had tried out a number of clipboards out, installed and then uninstalled properly via MX installer.
However there were
~/.conf/clipit?? and
.../copyq and ~/.config/autostart/ config files left behind. Deleted these and logged back in, problem fixed.
The
Clipman setting was being overridden by config files left behind.
I was alerted to this by a post somewhere about tigerVNC doing the save damage (damage to my freaking brain).
Clipman issue is solved.
And any app (Terminal, Geany etc) that does not have its own setting for this will still Middle-Mouse-wheel Click to Paste ... still works the old unix way with auto copy-selection and middle-wheel-paste.
Re: How to disable Middle-Mouse-wheel Click to Paste (XFCE)
Posted: Sat Dec 05, 2020 1:41 am
by JayM
If this is solved to your satisfaction, could you please edit your
original post #1 at the very top of the topic by clicking the pencil tip icon, the one circled in red in my screenshot image below (yours won't have the red circle)

and add [SOLVED] at the front of the subject? This will make it easier for others when they search the forum looking for a solution to the same problem. Thanks.