Peppermint OS Community Forum

Support => New Users => Topic started by: John Jenson on July 11, 2019, 09:52:58 am

Title: Default mouse behavior
Post by: John Jenson on July 11, 2019, 09:52:58 am
The default mouse behavior is for the middle mouse button to paste what is on the clipboard to whatever the pointer is pointing to. I would like to disable this behavior, but I cannot find anywhere in the settings to do this.

When I accidentally push the scroll wheel (middle button) or the mouse falls on the floor and lands on the middle button, whatever is on the clipboard gets pasted to whatever window is open at the time. Being a software engineer, this presents a hazard as a piece of software will then compile with errors and I have to spend time searching through the code to find whatever it was that got pasted in. I've dealt with this behavior for a long time, but I'm now fed up.

Please help me remove this annoyance.
Title: Re: Default mouse behavior
Post by: PCNetSpec on July 11, 2019, 01:59:41 pm
Try this
run:
Code: [Select]
sudo apt-get install xdotool xsel
then:
Code: [Select]
xed $HOME/.config/peppermint-control-center/xbindkeys.conf
and add these 2 new lines at the bottom
Code: [Select]
"echo -n | xsel -n -i; pkill xbindkeys; xdotool click 2; xbindkeys -f $HOME/.config/peppermint-control-center/xbindkeys.conf"
    b:2 + Release
SAVE the file and exit the text editor.

Back in the terminal reload the xbindkeys config file with:
Code: [Select]
xbindkeys -f $HOME/.config/peppermint-control-center/xbindkeys.conf
Title: Re: Default mouse behavior
Post by: John Jenson on July 11, 2019, 05:04:34 pm
I was going to, but noticed it's already there.
Title: Re: Default mouse behavior
Post by: PCNetSpec on July 11, 2019, 05:08:24 pm
What's already there ?
Title: Re: Default mouse behavior
Post by: John Jenson on July 11, 2019, 10:49:47 pm
What's already there ?

The line you asked me to save in that file.
Title: Re: Default mouse behavior
Post by: PCNetSpec on July 12, 2019, 09:08:42 am
What's the contents of
Code: [Select]
xed ~/.config/peppermint-control-center/xbindkeys.conf
because something tells me you've previously tried some instructions you've seen on the web, but they're not EXACTLY as I posted them
Title: Re: Default mouse behavior
Post by: John Jenson on July 13, 2019, 12:03:38 am
I haven't followed anyone's instructions and I haven't modified that file since I installed Peppermint.

Here is what the file contains:

Code: [Select]
"calc"
    Mod4+F5

"x-terminal-emulator"
    Control+Alt+t

"nemo"
    Mod4+e

"nemo"
    Control+Alt+f

"xfrun4"
    Mod4+r

"xfrun4"
    Alt+F2

"xfce4-popup-whiskermenu"
    Alt+F1

"xfce4-popup-whiskermenu"
    Control+Escape

"xfce4-popup-whiskermenu"
    Super_L

"peppermint-logout"
    Control+Alt+Delete

"scrot 'Screenshot_%Y-%m-%d_%H:%M:%S.png' -e 'mv $f ~/Desktop/'"
    Print

"scrot -u -b 'Windowshot_%Y-%m-%d_%H:%M:%S.png' -e 'mv $f ~/Desktop/'"
    Control+Print

"peppermint-scrot-helper.sh"
    Control+Shift+Print

"lxlock"
    Control+Alt+l

"amixer -q sset Master 3%+ unmute"
    XF86AudioRaiseVolume

"amixer -q sset Master 3%- unmute"
    XF86AudioLowerVolume

"amixer -q sset Master toggle"
    XF86AudioMute

"galculator"
    XF86Calculator

"nemo"
    XF86MyComputer

"sleep 2;xset dpms force off"
    Control+Shift+F7

"peppermint-logout"
    XF86PowerOff

"xfce4-find-cursor"
    Alt+c

"echo -n | xsel -n -i; pkill xbindkeys; xdotool click 2; xbindkeys -f $HOME/.config/peppermint-control-center/xbindkeys.conf"
    b:2 + Release
Title: Re: Default mouse behavior
Post by: PCNetSpec on July 13, 2019, 09:42:23 am
Trust me, those 2 lines are NOT there by default (I'm the person that created that file)...

I can prove it too .. that file is copied from /etc/skel/.config/peppermint-control-center/xbindkeys.conf to the users home folder upon account creation (during install) ,.. and that line ISN'T in:
Code: [Select]
xed /etc/skel/.config/peppermint-control-center/xbindkeys.conf
So you must have added them.
Title: Re: Default mouse behavior
Post by: John Jenson on July 15, 2019, 07:43:37 am
I never added that myself. Perhaps and update/upgrade or a software install put it there.

Anyway, regardless of how it got there; what can I do to stop that middle mouse button behavior?
Title: Re: Default mouse behavior
Post by: PCNetSpec on July 15, 2019, 10:30:59 am
No update added it, and no third party software would know where we keep the xbindkeys.conf file (that keybinding is VERY specific to Peppermint). Maybe you added it accidentally (by clicking the middle mouse button after copying it on this page), but did you test whether it worked by reloading the xbindkeys config file or rebooting ?

Anyway, if that didn't work (it works for me), what's the output from:
Code: [Select]
xinput --list
Title: Re: Default mouse behavior
Post by: John Jenson on July 15, 2019, 11:18:16 am
⎡ Virtual core pointer                       id=2   [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                 id=4   [slave  pointer  (2)]
⎜   ↳ USB Wired Keyboard                         id=9   [slave  pointer  (2)]
⎜   ↳ Microsoft Microsoft 3-Button Mouse with IntelliEye(TM)   id=10   [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 Wired Keyboard                         id=8   [slave  keyboard (3)]
    ↳ HP WMI hotkeys                             id=11   [slave  keyboard (3)]
Title: Re: Default mouse behavior
Post by: PCNetSpec on July 15, 2019, 03:15:01 pm
What's the output from:
Code: [Select]
xinput --list-props "Microsoft Microsoft 3-Button Mouse with IntelliEye(TM)"
and can you answer my other question too .. did you TEST the last solution properly ?
Title: Re: Default mouse behavior
Post by: John Jenson on July 15, 2019, 04:32:33 pm
Device 'Microsoft Microsoft 3-Button Mouse with IntelliEye(TM)':
   Device Enabled (138):   1
   Coordinate Transformation Matrix (140):   1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
   Device Accel Profile (264):   0
   Device Accel Constant Deceleration (265):   1.000000
   Device Accel Adaptive Deceleration (266):   1.000000
   Device Accel Velocity Scaling (267):   10.000000
   Device Product ID (258):   1118, 64
   Device Node (259):   "/dev/input/event4"
   Evdev Axis Inversion (268):   0, 0
   Evdev Axes Swap (270):   0
   Axis Labels (271):   "Rel X" (148), "Rel Y" (149), "Rel Vert Wheel" (287)
   Button Labels (272):   "Button Left" (141), "Button Middle" (142), "Button Right" (143), "Button Wheel Up" (144), "Button Wheel Down" (145), "Button Horiz Wheel Left" (146), "Button Horiz Wheel Right" (147)
   Evdev Scrolling Distance (273):   1, 1, 1
   Evdev Middle Button Emulation (274):   0
   Evdev Middle Button Timeout (275):   50
   Evdev Middle Button Button (276):   2
   Evdev Third Button Emulation (277):   0
   Evdev Third Button Emulation Timeout (278):   1000
   Evdev Third Button Emulation Button (279):   3
   Evdev Third Button Emulation Threshold (280):   20
   Evdev Wheel Emulation (281):   0
   Evdev Wheel Emulation Axes (282):   0, 0, 4, 5
   Evdev Wheel Emulation Inertia (283):   10
   Evdev Wheel Emulation Timeout (284):   200
   Evdev Wheel Emulation Button (285):   4
   Evdev Drag Lock Buttons (286):   0


As for last solution being properly tested, I don't know.

I opened "$HOME/.config/peppermint-control-center/xbindkeys.conf"

then I scrolled to the last line to add this:

"echo -n | xsel -n -i; pkill xbindkeys; xdotool click 2; xbindkeys -f $HOME/.config/peppermint-control-center/x$
    b:2 + Release"

...but it was already in there. I didn't think entering in there again would help, so I closed the file and then ran:

"xbindkeys -f $HOME/.config/peppermint-control-center/xbindkeys.conf" like you asked.

Then I hit the scroll wheel button and it emptied the contents of the clipboard into the terminal window; so it hasn't been fixed. Did I miss something?
Title: Re: Default mouse behavior
Post by: PCNetSpec on July 15, 2019, 04:34:12 pm
Are you running a clipboard manager ?
Title: Re: Default mouse behavior
Post by: John Jenson on July 15, 2019, 05:00:29 pm
No.
Title: Re: Default mouse behavior
Post by: PCNetSpec on July 15, 2019, 06:04:25 pm
Try running
Code: [Select]
xinput set-button-map "Microsoft Microsoft 3-Button Mouse with IntelliEye(TM)" 1 0 3
OR
Code: [Select]
xmodmap -e "pointer = 1 0 3"
The first option would be better because it disable the middle mouse button JUST for the Microsoft Mouse .. the second option disables the middle button on ALL mice/touchpads/pointing sticks/etc.

To re-enable, just replace 1 0 3 with 1 2 3 in the commands.

Also be aware these won't survive a reboot (they'll need to be re-entered), but if they work and you're happy with either as a solution, we can autorun it at login.
Title: Re: Default mouse behavior
Post by: John Jenson on July 15, 2019, 07:25:46 pm
The first one worked and the new setting actually did survive a reboot. They probably use NVRAM in the mouse.

So does this mean that this clipboard functionality is built into the mouse and isn't configurable in software? I do use the middle button occasionally in certain software. Does this mean my only option is to get another mouse?
Title: Re: Default mouse behavior
Post by: John Jenson on July 15, 2019, 07:47:30 pm
According to this post https://www.ghacks.net/2006/09/11/copy-paste-with-middle-mouse-button/ (https://www.ghacks.net/2006/09/11/copy-paste-with-middle-mouse-button/)

I received an email some days ago from a reader who wanted to know if there was a program for Microsoft Windows operating systems that replicated the middle mouse functionality of Linux systems.

If you click on the middle mouse button on a machine running a flavor of Linux, you copy the text that is selected, and if you middle-click once again while a form or text field is active, it is automatically pasted into it.


This is the exact feature I'm talking about. So is this functionality built into Peppermint? If it is, there should be a way of disabling it without turning off the middle mouse button.
Title: Re: Default mouse behavior
Post by: PCNetSpec on July 16, 2019, 09:13:35 am
It's built into Gtk, and AFAIK can only (now) be disabled via a patch to the source code .. something we'll not do (on our own) as that would make a large proportion of Peppermint diverge from upstream libraries with possible unforeseen implications.

I'd agree that Gtk should probably provide an easier method for disabling, but that's something you'd have to take up with Gnome.
Title: Re: Default mouse behavior
Post by: John Jenson on July 16, 2019, 02:49:27 pm
Okay, thanks for all your help. At least I can now switch this off when I need to.