How do I disable middle mouse button click paste?How do I disable pasting when clicking the middle mouse button/wheel?How to turn off copy function when pressing mouse wheel?How to disable mouse wheel paste?Why is the middle button mapped to pasting?Any updates on disabling middle-click paste?paste selected text: switch right and middle clickIs it possible to get the first click on an inactive window to not register?Disable mouse middle button click paste on KDE, keeping that button workingMiddle mouse key pastes last selected textHow do I get my old xmodmap settings back?Sensitive middle-button (mouse)How does Middle Click paste work?Pasting from vim in terminal to Google Docs (Firefox + Vimperator) - need to understandHow to ENABLE paste in terminal with (middle) mouse buttonDeactivate middle-button-paste on one specific HIDMiddle mouse button will not pasteDisable mouse middle button click paste on KDE, keeping that button workingXubuntu 17.04: Problem with radical change in middle mouse button behaviorMouse middle click copy-and-paste in Ubuntu 17.10Middle mouse key pastes last selected text

Why in book's example is used 言葉(ことば) instead of 言語(げんご)?

Why has "pence" been used in this sentence, not "pences"?

Can I sign legal documents with a smiley face?

Customize circled numbers

Structured binding on const

Will adding a BY-SA image to a blog post make the entire post BY-SA?

Proof of Lemma: Every nonzero integer can be written as a product of primes

Why did the EU agree to delay the Brexit deadline?

Is camera lens focus an exact point or a range?

Greatest common substring

What does this horizontal bar at the first measure mean?

We have a love-hate relationship

Difference between -| and |- in TikZ

Is XSS in canonical link possible?

How do you respond to a colleague from another team when they're wrongly expecting that you'll help them?

MAXDOP Settings for SQL Server 2014

Reply ‘no position’ while the job posting is still there (‘HiWi’ position in Germany)

Does having a TSA Pre-Check member in your flight reservation increase the chances that everyone gets Pre-Check?

Is there a word to describe the feeling of being transfixed out of horror?

Generating adjacency matrices from isomorphic graphs

Could solar power be utilized and substitute coal in the 19th century?

How will losing mobility of one hand affect my career as a programmer?

How to color a curve

How much character growth crosses the line into breaking the character



How do I disable middle mouse button click paste?


How do I disable pasting when clicking the middle mouse button/wheel?How to turn off copy function when pressing mouse wheel?How to disable mouse wheel paste?Why is the middle button mapped to pasting?Any updates on disabling middle-click paste?paste selected text: switch right and middle clickIs it possible to get the first click on an inactive window to not register?Disable mouse middle button click paste on KDE, keeping that button workingMiddle mouse key pastes last selected textHow do I get my old xmodmap settings back?Sensitive middle-button (mouse)How does Middle Click paste work?Pasting from vim in terminal to Google Docs (Firefox + Vimperator) - need to understandHow to ENABLE paste in terminal with (middle) mouse buttonDeactivate middle-button-paste on one specific HIDMiddle mouse button will not pasteDisable mouse middle button click paste on KDE, keeping that button workingXubuntu 17.04: Problem with radical change in middle mouse button behaviorMouse middle click copy-and-paste in Ubuntu 17.10Middle mouse key pastes last selected text













115















Is there a way to disable the middle mouse button paste behavior that is here by default on gnome?



I have a sensitive mouse wheel and whenever I scroll texts, sometimes it pastes stuff randomly into the text. I lose quite a lot of credibility when I send a file to someone else that has random text snippets pasted all over it.



I have seen a solution that goes by mapping the mouse's middle button to a non-existant mouse button, but that implies getting rid of the middle mouse button altogether (i.e. no tab-closing, opening links into a new tab automatically, etc.). I'd like to keep my middle mouse button active, just disable the pasting behavior.



This also happens when I scroll text with my touchpad (accidentally hit two-fingers without moving, bam.)



So the problem will not be fixed just by changing for a new mouse (in fact I believe it happens more often with my touchpad than with my mouse).










share|improve this question



















  • 3





    s/sensible/sensitive/

    – Dennis Williamson
    Sep 21 '10 at 15:48






  • 2





    Really annoying default behaviour. How did you disable it?

    – umpirsky
    Jun 20 '11 at 14:09






  • 1





    @umpirsky: Haven't found a proper way to disable it yet.

    – levesque
    Jun 20 '11 at 16:04






  • 5





    If your mouse records middle clicks while you just want to scroll, I'd suggest you to try another mouse model (probably one with a higher pressure to click the wheel). After several years of Linux use I've never been bothered with your issue, actually the middle click paste proved itself to be quite useful :)

    – Maxime R.
    Jan 12 '12 at 14:50






  • 3





    @umpirsky I would hardly call it idiotic; however, I agree that it can be rather annoying (especially when simply scrolling in a graphical program)

    – Vreality
    Feb 13 '13 at 22:39















115















Is there a way to disable the middle mouse button paste behavior that is here by default on gnome?



I have a sensitive mouse wheel and whenever I scroll texts, sometimes it pastes stuff randomly into the text. I lose quite a lot of credibility when I send a file to someone else that has random text snippets pasted all over it.



I have seen a solution that goes by mapping the mouse's middle button to a non-existant mouse button, but that implies getting rid of the middle mouse button altogether (i.e. no tab-closing, opening links into a new tab automatically, etc.). I'd like to keep my middle mouse button active, just disable the pasting behavior.



This also happens when I scroll text with my touchpad (accidentally hit two-fingers without moving, bam.)



So the problem will not be fixed just by changing for a new mouse (in fact I believe it happens more often with my touchpad than with my mouse).










share|improve this question



















  • 3





    s/sensible/sensitive/

    – Dennis Williamson
    Sep 21 '10 at 15:48






  • 2





    Really annoying default behaviour. How did you disable it?

    – umpirsky
    Jun 20 '11 at 14:09






  • 1





    @umpirsky: Haven't found a proper way to disable it yet.

    – levesque
    Jun 20 '11 at 16:04






  • 5





    If your mouse records middle clicks while you just want to scroll, I'd suggest you to try another mouse model (probably one with a higher pressure to click the wheel). After several years of Linux use I've never been bothered with your issue, actually the middle click paste proved itself to be quite useful :)

    – Maxime R.
    Jan 12 '12 at 14:50






  • 3





    @umpirsky I would hardly call it idiotic; however, I agree that it can be rather annoying (especially when simply scrolling in a graphical program)

    – Vreality
    Feb 13 '13 at 22:39













115












115








115


37






Is there a way to disable the middle mouse button paste behavior that is here by default on gnome?



I have a sensitive mouse wheel and whenever I scroll texts, sometimes it pastes stuff randomly into the text. I lose quite a lot of credibility when I send a file to someone else that has random text snippets pasted all over it.



I have seen a solution that goes by mapping the mouse's middle button to a non-existant mouse button, but that implies getting rid of the middle mouse button altogether (i.e. no tab-closing, opening links into a new tab automatically, etc.). I'd like to keep my middle mouse button active, just disable the pasting behavior.



This also happens when I scroll text with my touchpad (accidentally hit two-fingers without moving, bam.)



So the problem will not be fixed just by changing for a new mouse (in fact I believe it happens more often with my touchpad than with my mouse).










share|improve this question
















Is there a way to disable the middle mouse button paste behavior that is here by default on gnome?



I have a sensitive mouse wheel and whenever I scroll texts, sometimes it pastes stuff randomly into the text. I lose quite a lot of credibility when I send a file to someone else that has random text snippets pasted all over it.



I have seen a solution that goes by mapping the mouse's middle button to a non-existant mouse button, but that implies getting rid of the middle mouse button altogether (i.e. no tab-closing, opening links into a new tab automatically, etc.). I'd like to keep my middle mouse button active, just disable the pasting behavior.



This also happens when I scroll text with my touchpad (accidentally hit two-fingers without moving, bam.)



So the problem will not be fixed just by changing for a new mouse (in fact I believe it happens more often with my touchpad than with my mouse).







xorg clipboard






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 11 '13 at 11:31









Flyk

1,38931624




1,38931624










asked Sep 21 '10 at 15:26









levesquelevesque

2,13342130




2,13342130







  • 3





    s/sensible/sensitive/

    – Dennis Williamson
    Sep 21 '10 at 15:48






  • 2





    Really annoying default behaviour. How did you disable it?

    – umpirsky
    Jun 20 '11 at 14:09






  • 1





    @umpirsky: Haven't found a proper way to disable it yet.

    – levesque
    Jun 20 '11 at 16:04






  • 5





    If your mouse records middle clicks while you just want to scroll, I'd suggest you to try another mouse model (probably one with a higher pressure to click the wheel). After several years of Linux use I've never been bothered with your issue, actually the middle click paste proved itself to be quite useful :)

    – Maxime R.
    Jan 12 '12 at 14:50






  • 3





    @umpirsky I would hardly call it idiotic; however, I agree that it can be rather annoying (especially when simply scrolling in a graphical program)

    – Vreality
    Feb 13 '13 at 22:39












  • 3





    s/sensible/sensitive/

    – Dennis Williamson
    Sep 21 '10 at 15:48






  • 2





    Really annoying default behaviour. How did you disable it?

    – umpirsky
    Jun 20 '11 at 14:09






  • 1





    @umpirsky: Haven't found a proper way to disable it yet.

    – levesque
    Jun 20 '11 at 16:04






  • 5





    If your mouse records middle clicks while you just want to scroll, I'd suggest you to try another mouse model (probably one with a higher pressure to click the wheel). After several years of Linux use I've never been bothered with your issue, actually the middle click paste proved itself to be quite useful :)

    – Maxime R.
    Jan 12 '12 at 14:50






  • 3





    @umpirsky I would hardly call it idiotic; however, I agree that it can be rather annoying (especially when simply scrolling in a graphical program)

    – Vreality
    Feb 13 '13 at 22:39







3




3





s/sensible/sensitive/

– Dennis Williamson
Sep 21 '10 at 15:48





s/sensible/sensitive/

– Dennis Williamson
Sep 21 '10 at 15:48




2




2





Really annoying default behaviour. How did you disable it?

– umpirsky
Jun 20 '11 at 14:09





Really annoying default behaviour. How did you disable it?

– umpirsky
Jun 20 '11 at 14:09




1




1





@umpirsky: Haven't found a proper way to disable it yet.

– levesque
Jun 20 '11 at 16:04





@umpirsky: Haven't found a proper way to disable it yet.

– levesque
Jun 20 '11 at 16:04




5




5





If your mouse records middle clicks while you just want to scroll, I'd suggest you to try another mouse model (probably one with a higher pressure to click the wheel). After several years of Linux use I've never been bothered with your issue, actually the middle click paste proved itself to be quite useful :)

– Maxime R.
Jan 12 '12 at 14:50





If your mouse records middle clicks while you just want to scroll, I'd suggest you to try another mouse model (probably one with a higher pressure to click the wheel). After several years of Linux use I've never been bothered with your issue, actually the middle click paste proved itself to be quite useful :)

– Maxime R.
Jan 12 '12 at 14:50




3




3





@umpirsky I would hardly call it idiotic; however, I agree that it can be rather annoying (especially when simply scrolling in a graphical program)

– Vreality
Feb 13 '13 at 22:39





@umpirsky I would hardly call it idiotic; however, I agree that it can be rather annoying (especially when simply scrolling in a graphical program)

– Vreality
Feb 13 '13 at 22:39










21 Answers
21






active

oldest

votes


















14














For a solution to the problem, please view this guide I wrote



Or, more directly, here's the patch to disable the 'middle mouse button paste' functionality in GTK.






share|improve this answer

























  • I haven't had the time to try it (partly because I no longer have a laptop), but this seems like the solution to my problem :)

    – levesque
    Nov 28 '11 at 20:50






  • 1





    I'm using Ubuntu 12.04 64 bit with gtk 2.0-0_2.24.10, and it failed on the dpkg-buildpackage line. It wouldn't build with uncommitted local changes, so I had to run dpkg-source --commit.

    – Sam King
    Aug 21 '12 at 14:54







  • 1





    @Sam: Thanks for the heads up. Apparently, the --source-option=--auto-commit option can be passed to dpkg-buildpackage (which is somewhat more convenient as one doesn't have to edit the change log). I've updated the guide to reflect this.

    – Jelle Geerts
    Aug 26 '12 at 23:40






  • 1





    I tried this solution, but every time I got to the sudo apt-get build-dep libgtk2.0-0 part I get an error with Picking 'gtk+2.0' as source package instead of 'libgtk2.0-0' E: Unable to find a source package for gtk+2.0 Help?

    – FCTW
    Jul 4 '13 at 17:38






  • 1





    @FCTW: I suspect the cause of the problem is that GTK3 has replaced GTK2 in modern distributions. Hence, you'll have to find the package name of the installed GTK3 library, by running a command like dpkg -l | grep libgtk. It's probably something like libgtk-3-0. I have verified my patch to work on early versions of GTK3; hopefully it still works.

    – Jelle Geerts
    Jul 12 '13 at 12:51


















31














Jared Robinson gave a simple solution that works on my machine:



Run the following command:



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


To persist this behavior, edit ~/.Xmodmap and add



pointer = 1 25 3 4 5 6 7 8 9





share|improve this answer




















  • 23





    Doesn't this just disable the middle button altogether? What about closing tabs, opening links to new tabs, etc.?

    – levesque
    Aug 7 '11 at 17:36






  • 2





    Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.

    – Kris Harper
    Sep 2 '11 at 17:02







  • 19





    @HDave How on earth should this be marked as the answer to a question that specifically states he's seen solutions that rebind the middle mouse to a different key, but those are not satisfactory? That's exactly what this answer does.

    – Thor84no
    Apr 2 '14 at 14:56






  • 3





    Can anyone provide an explanation as to what this series of magic numbers means?

    – Neil Traft
    Oct 6 '15 at 22:03






  • 1





    @Neil Traft I havent looked into this exact configuration too much but from my understanding of input event systems when you have an input device like a mouse, it sends back standard input events when buttons are pressed these events tell you that "a button changed state", "that button has id X", and "it current state is pressed/released" normally gtk modifies the input events it receives to map buttons ids [0,1,2,3,4,5,6,7,8] to [1,2,3,4,5,6,7,8,9] keep in mind only the first 3 button ids are used on most mice to indicate the button id for left, middle and right. so middle is now id 25

    – S E
    Nov 3 '15 at 14:09


















30














I use gnome-tweak-tool for disabling middle button paste in Ubuntu 16.04.




  1. Install it



    sudo apt install gnome-tweak-tool


  2. Run it by searching "tweak tool" in installed apps or just type gnome-tweak-tool in a terminal.


  3. Go to "Keyboard and mouse" -> "Middle-click paste"


  4. Turn off.



    screenshot



That's it.



Or using just CLI



gsettings set org.gnome.desktop.interface gtk-enable-primary-paste false


Tested on 16.04.






share|improve this answer




















  • 1





    Worked like a charm! I was losing hope so quickly. Thank you!

    – theY4Kman
    Feb 8 '17 at 19:43






  • 2





    it doesn't work after restart :'(

    – Ahmad Muzakki
    Apr 2 '17 at 5:55






  • 1





    Worked, of course! Why isn't this the top answer?

    – CodeMouse92
    Apr 19 '17 at 1:50






  • 6





    Using the Tweaks tool would be by far the nicest way to do this, if it worked. I switched off the middle-click paste and it is still middle-click pasting same as before. Same after a restart. Anyone solve a similar issue?

    – Kvothe
    Jul 25 '18 at 22:53






  • 3





    Also interesting, an explanation for the weird middle-click behaviour of overwriting the clipboard buffer with the current selection: askubuntu.com/a/225879/653860 (But sadly, disabling the middle mouse button altogether, as proposed in that answer, also disables my mouse wheel completely. It seems there is no simple way to get rid of this stupid behaviour without destroying other crucial input functionality. Very bad design... :/ )

    – trollkotze
    Jul 30 '18 at 14:56



















26














I realise that this is not exactly the answer you want, but you can turn this off in Firefox (e.g. if you don't mind the feature elsewhere, but still want middle click in Firefox to open links in new tabs)



In about:config, set



middlemouse.contentLoadURL false
middlemouse.paste false


Not what you asked, but as this question is linked to from a few places I hope someone finds this answer useful.






share|improve this answer


















  • 3





    +1 That is helpful. I'll also add that in LibreOffice you can do this in Tools/Options/LibreOffice/View/Mouse change 'Middle mouse button' to your preferred setting.

    – Tom Brossman
    Oct 3 '12 at 10:30


















21














This currently isn't possible - though, as you have mentioned, there are ways to disable the MOUSE 3 button - or remap it- none of those get at the source of the issue. The X11 Primary Selection.



While this isn't a solution, hopefully this explanation will make it clear WHY. In Ubuntu there are two clipboards at work. One, which everyone is familiar with, the freedesktop.org clipboard (captures Ctrl+C command) The second is a clipboard manager that has been at play since before Ubuntu even existed - X11. The X Server (X11) manages three other clipboards: Primary Selection, Secondary Selection, and Clipboard. When you select text with your pointer it gets copied to a buffer in the XServer, the Primary Selection, and awaits pasting by means of the Mouse 3 button. The other two were designed to be used by other applications in a means to share a common clipboard between applications. In this case the freedesktop.org clipboard manager in Ubuntu already does this for us.



Through the extent of my research I can not find a way to disable the X11 selection manager. There are no compilation flags, applications, or configuration values that can disable this. There are various ways around this on a per application basis (majority of these applications being command line ones) - but nothing on a global scale.



I realize this isn't an ideal solution - but seems to be the truth to the issue. The only relevant solution I could muster is actually a hack, create a script that executes an infinite while loop that just replaces the Primary Selection with a null value.



First install xsel (Tool for manipulation of the X selection) sudo apt-get install xsel



The code is as follows:



while(true)
do
echo -n | xsel -n -i
sleep 0.5
done


If you place this in a script and add it to your startup scripts this shouldn't be an issue.






share|improve this answer




















  • 4





    Any chance for a script that just clears the buffer instead of cancelling all selections?

    – levesque
    Oct 29 '10 at 20:16







  • 2





    while(true)? Looks like it will kill the CPU :)

    – umpirsky
    Jul 8 '11 at 10:54











  • I've tried mapping butons by adding Option "ButtonMapping" "1 1 3 4 5" to xorg.conf, but the problem resists.

    – umpirsky
    Jul 8 '11 at 11:32






  • 4





    @umpirsky The while(true) is not a problem because the loop contains sleep 0.5 which relinquishes half a second of CPU time in each of the loop's iterations. Because of that (and the lightweightness of the xsel command invocation which comprises the other part of the loop), the CPU resources taken up by the loop will be exceedingly tiny even on the slowest of Ubuntu machines.

    – Eliah Kagan
    Nov 28 '11 at 7:16






  • 4





    This doesn't seem to work well on Unity because the script clears any existing selection in a terminal, which means you cannot copy test from a terminal by any means (by the time you try to copy, the text is unselected).

    – Fantius
    May 18 '12 at 18:45


















17














Somehow, I ended up without any xmodmap files on my Ubuntu install, so I had to find a different approach to this problem.



Take a look at the xinput command.



xinput list | grep -i mouse


which lists information about your mouse. It shows my mouse is "Dell Premium USB Optical Mouse" and also that I have "Macintosh mouse button emulation". Armed with that info, I can



xinput get-button-map "Dell Premium USB Optical Mouse"


which gives me a listing that looks like



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18


Here is the useful, required knowledge. My mouse has, theoretically, 18 buttons. Each button's default action has the same name as it's button number. In other words, button 1 does action 1, button 4 does action 4, etc. Action 0 means "off".



The position in the listing shows the function assigned to that button. So if my button map read



1 3 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 


this would mean button 1 (position 1) does action 1 (normal left button), button 2 (position 2) does action 3 (middle button) and button 3 (position 3) does action 2 (right button).



To make a left handed mouse all you would need would be a button map that starts



3 2 1 4 5 .....


Or, in your case, it looks like you want the middle button to do the same thing as button 1 (left button) so your map needs to start



1 1 3 ....


I'd reset my mouse button mappings thus:



xinput set-button-map "Dell Premium USB Optical Mouse" 1 1 3 5 6 6 7 8 9 10 11 12 13 14 15 16 17 18


In your case, you may have a different number of mapped buttons and have some special button map already defined. Likwely, your mouse has a different name, too. First, get your mouse's "name". Then, use the get-button-map operation to find your base button map. finally, use the set-button-map option, modifying button 2 to do action 1.



This is not a permanent change. I added the necessary code to my .bashrc so it executes every time I login or open a terminal.



Hope this helps.






share|improve this answer

























  • Thanks for the info. It explains a little more about the mouse buttons and the actions applied to them. However, it isn't the solution I am looking for. If you left-click a tab in Chrome (to use my example) it selects it (if not selected already). Clicking it with the middle button, will close it (i.e. without clicking the X). I also miss middle-clicking a link to have it open in a new tab for later reading. I realise I can overcome these with alternatives but I am used to this way of working....

    – neildeadman
    Jan 12 '12 at 14:18











  • Just a thought; any of the other buttons on your mouse, mine say I have 18 buttons though I have yet to physically find more than about 8 of them) may be the function you want. Try mapping other buttons to your third button and see if you find something useful.

    – Wes Miller
    Jan 13 '12 at 13:04






  • 1





    If you remap as a two button mouse, it shouldn't change the wheelfunction since the wheel rolls are pressing button 5 and 6 (or 7 and 8 or something like that).

    – Wes Miller
    Jan 13 '12 at 13:09











  • I can confirm that this works on both the built in ThinkPad trackpoint and the Lenovo keyboard that has the same layout. The get-button-map on the Lenovo keyboard comes back with 22 buttons for me, but the same set-button-map <<name-or-id>> 1 0 3 approach works for me

    – Milimetric
    Aug 17 '15 at 14:44












  • this is the answer (though I think your description is off) - get-button-map links the position in the list to the physical button, which is the opposite of xmodmap, which links the position in the list to the function. Using the set-button-map, we can map two physical buttons to one logical position. Works on an asus zenbook pro for me.

    – zzzeek
    Sep 7 '16 at 15:01


















4














I suggest using one of these, which work mostly well for me:



using xbindkeys:
whenever middle-button is pressed, clear the primary clipboard. At least on my system it is cleared, before the pasting happens.
Details: create xbindkeys-config:



xbindkeys --defaults > $HOME/.xbindkeysrc


Paste the following new hotkey:



"xclip -i /dev/null" 
b:2``


Reload xbindkeys (e.g. killall xbindkeys;xbindkeys). Done.



using xdotool:
Clear the clipboard on window focus change (should work with most windowmanagers). Details:
Execute the following command:



xdotool search --onlyvisible . behave %@ focus exec xclip -i /dev/null


Note that with this command you can still use the primary clipboard within the same window, or pressing middlemouse onto another window BEFORE focusing it (if you don't have "focus follows mouse", or somthing, activated).






share|improve this answer






























    3














    The best way I've found so far is to use EasyStroke, which can globally intercept middle-button click and allow to behave as middle button only in certain apps.



    You can add a "group" in EasyStroke to apply this interception in multiple applications at once.
    I've set to disable middle click in some of my text editors, IDE and MATLAB only and works as intended.



    Reference:
    http://ubuntuforums.org/showpost.php?p=11811126&postcount=25



    Complete EasyStroke How-To:
    http://sourceforge.net/apps/trac/easystroke/wiki/Documentation






    share|improve this answer























    • Thanks from the future for that tip. At first, I was going to just use xinput to disable it totally, and not need to run some extra program, but EasyStroke made it possible to set groups where I could disable the middle button for certain apps (my editor, mainly), and add gestures to certain other apps and using the middle button. So far, works well (14.04 Gnome fallback).

      – Marty Fried
      Aug 1 '15 at 18:30











    • Added to my comment: after using EasyStroke for a while, I've found that it often fails to block the middle click. Since I haven't been using the gestures, I am abandoning this program for xinput.

      – Marty Fried
      Aug 19 '15 at 16:26


















    2














    This middle mouse button paste behavior is a feature of the X server (and gpm on the text console) and as far as I know at least X.org can't be configured to disable it - all you can do is to change the mapping of the physical mouse buttons as others already suggested.



    Chances are good that you can configure your touchpad to avoid unwanted middle clicks, see gpointing-device-settings (not installed by default) or the synaptics manpage if you prefer to use your editor for configuration.






    share|improve this answer






























      2














      the link below fixed the problem for me.



      https://wiki.ubuntu.com/X/Config/Input#Example:_Disabling_middle-mouse_button_paste_on_a_scrollwheel_mouse



      the page refered by the above link has a section for how to disable the middle mouse paste on scrollwheel, by executing few commands the user can fetch the mouse buttons mapping and can also change the mapping.
      as explained in the page i disabled the the middle button by executing the command:



      $ xinput set-button-map 4 1 0 3





      share|improve this answer




















      • 4





        The OP specifically mentioned he did not want to completely disable the middle click button.

        – cpburnz
        Aug 25 '14 at 14:09


















      2














      Here's the simplest solution I've found to keep middle click functional without it pasting things.



      First install sxhkd and xsel.



      Then configure ./.config/.sxhkd/sxhkdrc like so



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


      And that's basically it.



      Now start sxhkd (or configure it to launch on startup). Now, middle mouse will no longer paste anything but will otherwise function like normal. (As long as you use only ctrl+c and ctrl+x to copy things that is, if you copy things with the mouse it can paste once before it returns to normal.)






      share|improve this answer
































        1














        I had the same problem a few months ago and I solved it by changing the mouse! But, as you, I was frustrated that simple button mapping problem can't be solved elegantly by a software fix. Fortunately, I had the problem on my job computer, and my employer owns a variety of spare mouse controllers. It was a no cost fix!



        I think a proper mouse hardware implementation should not send random middle clicks while scrolling. Recently I found this behaviour to get annoying even while using Windows!



        Now that I've fixed the hardware bug with the proper hardware solution (change the mouse) I even started an addiction to "paste on middle-click" behaviour!!



        Happy linuxing!



        Sincerly,






        share|improve this answer






























          1














          SW:
          Ubuntu 14.04, with Gnome fall back.
          HW: I have a laptop and so the middle button is actually the mouse on/in the laptop.
          Solution:
          Go to Ubuntu SW center and download Unity Tweak Tool.
          Start Tweak Tool. Under the Mouse settings it has switch to turn on/off the middle click insert.
          Have a lovely day.






          share|improve this answer























          • I have the same system. I downloaded Unity Tweak Tool and wasted time looking at every setting, but there was no such setting. Perhaps you meant "Tweak Tool", which is, I think, Gnome Tweak Tool. It has a setting, although it doesn't seem to work.

            – Marty Fried
            Aug 1 '15 at 16:42


















          1














          I tried the xinput-redirection trick, changing the center mouse "button" (actually a wheel) so it acts just like the left mouse button. It still works as a wheel, and has (apparently) stopped pasting things into random places in the middle of my source code as I scroll past.



          In my case the command was



          xinput set-button-map "PixArt USB Optical Mouse" 1 1 3 4 5 6 7 8 9 10 11 12 13 14 15 16


          but YMMV by mouse model.






          share|improve this answer
































            1














            I may have a partial answer for you, if you are using a lenovo X... with
            touchpoint/touchpad.
            There is a "known" bug with the synaptics mouse buttons. If you try a USB mouse
            and have no problem, but with the touchpad/touchpoint mouse (build into the keyboard) you do have random responses that can delete swaths of text as you type, then this may be the bug I'm talking about.



            https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1506817



            If this fits your situation, then add your name to the list of people who have identified this bug, at that bug report. Maybe if there are many more of us reporting this, it would get fixed.






            share|improve this answer






























              0














              It's more than a gnome feature, i think it works almost everywhere, it works in the console too, and I think it worked even in my "Linux from Scratch".



              So it's really a basic feature perhaps even somewhere in the kernel.



              BTW: It's really useful, and it's not the regular paste like Ctrl + V, everything that is marked with the cursor goes in a second storage and with middleclick can paste, what you marked last.






              share|improve this answer


















              • 1





                BTW2: It pastes where you click, not where the Text cursor is.

                – phiphi
                Sep 23 '10 at 18:13






              • 1





                It's great that you have that opinion, but that's not what the OP was asking!

                – Matt Fletcher
                Sep 13 '13 at 9:55


















              0














              Using what I learned in the posts above, this bash one-liner works perfectly for me...



              mouse_id=$(xinput list | grep 'Mouse' | awk 'print $9' | sed 's/[^0-9]//g') && xinput set-button-map "$mouse_id" 1 0 3





              share|improve this answer


















              • 1





                The OP specifically mentioned he did not want to completely disable the middle click button.

                – cpburnz
                Aug 25 '14 at 14:10











              • I modified your one-liner to support multiple mice: xinput list | grep 'Mouse' | grep -o 'id=[0-9]*' | grep -o '[0-9]*' | xargs -i xinput set-button-map "" 1 0 3

                – Kurt
                Oct 23 '18 at 21:04


















              0














              You might want to try emulating a two button mouse. With a two button mouse you paste by clicking both mouse buttons at the same time (rather then the scroll wheel).



              Install gpointing-device-settings:



              sudo aptitude install gpointing-device-settings


              http://live.gnome.org/GPointingDeviceSettings



              Alternately, if you do not wish to install gpointing-device-settings , and you are not bothered by command line options, see https://wiki.ubuntu.com/X/Config/Input On this wiki page there are several command line / configuration options, choose the one you prefer.






              share|improve this answer

























              • Will this still allow me to scroll in apps (such as Chrome) with the wheel though?? I'll give it a try, thanks!

                – neildeadman
                Jan 13 '12 at 8:12











              • App installs, but cannot see how it could help. Link to docs is broken.

                – HDave
                Feb 7 '14 at 19:48


















              0














              For Gnome applications you can use gnome-tweaks (new name of gnome-tweak-tool package) under the "Keyboard & Mouse" tab there's the "Middle Click Paste" option or editing directly the org.gnome.desktop.interface/gtk-enable-primary-paste Gnome option.



              For KDE applications seems that there's an equivalent solution.



              For the whole X (including non Gnome applications) you can install XMousePasteBlock which then has to be running (by the user is enough, no root required) in order to work. This disables completely the middle click paste without disabling the other middle click functions.






              share|improve this answer






























                -1














                That's a good question, which i don't have an answer for (yet).
                A quick and dirty workaround is to remap it NOT to 0, but to 1.
                This way, it turns middle-"click" to left click, and does not affect your scroller...
                It is so far the best I can think of.



                Note:This information came from Ubuntu Forums, not my own noggin! :)






                share|improve this answer






























                  -3














                  did you check out gpm ? More info at http://manpages.ubuntu.com/manpages/lucid/man8/gpm.8.html. Available via sudo aptitude install gpm on lucid. I don't see the disable-paste program in the ubuntu package however, the -A option may be worth giving a try.






                  share|improve this answer


















                  • 5





                    I don't understand gpm.. in the package description they state: "This package tries to be a useful mouse server for applications running on the Linux console." What does this have to do with applications running in windowed mode?

                    – levesque
                    Sep 21 '10 at 16:35










                  protected by Community Dec 15 '18 at 16:16



                  Thank you for your interest in this question.
                  Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).



                  Would you like to answer one of these unanswered questions instead?














                  21 Answers
                  21






                  active

                  oldest

                  votes








                  21 Answers
                  21






                  active

                  oldest

                  votes









                  active

                  oldest

                  votes






                  active

                  oldest

                  votes









                  14














                  For a solution to the problem, please view this guide I wrote



                  Or, more directly, here's the patch to disable the 'middle mouse button paste' functionality in GTK.






                  share|improve this answer

























                  • I haven't had the time to try it (partly because I no longer have a laptop), but this seems like the solution to my problem :)

                    – levesque
                    Nov 28 '11 at 20:50






                  • 1





                    I'm using Ubuntu 12.04 64 bit with gtk 2.0-0_2.24.10, and it failed on the dpkg-buildpackage line. It wouldn't build with uncommitted local changes, so I had to run dpkg-source --commit.

                    – Sam King
                    Aug 21 '12 at 14:54







                  • 1





                    @Sam: Thanks for the heads up. Apparently, the --source-option=--auto-commit option can be passed to dpkg-buildpackage (which is somewhat more convenient as one doesn't have to edit the change log). I've updated the guide to reflect this.

                    – Jelle Geerts
                    Aug 26 '12 at 23:40






                  • 1





                    I tried this solution, but every time I got to the sudo apt-get build-dep libgtk2.0-0 part I get an error with Picking 'gtk+2.0' as source package instead of 'libgtk2.0-0' E: Unable to find a source package for gtk+2.0 Help?

                    – FCTW
                    Jul 4 '13 at 17:38






                  • 1





                    @FCTW: I suspect the cause of the problem is that GTK3 has replaced GTK2 in modern distributions. Hence, you'll have to find the package name of the installed GTK3 library, by running a command like dpkg -l | grep libgtk. It's probably something like libgtk-3-0. I have verified my patch to work on early versions of GTK3; hopefully it still works.

                    – Jelle Geerts
                    Jul 12 '13 at 12:51















                  14














                  For a solution to the problem, please view this guide I wrote



                  Or, more directly, here's the patch to disable the 'middle mouse button paste' functionality in GTK.






                  share|improve this answer

























                  • I haven't had the time to try it (partly because I no longer have a laptop), but this seems like the solution to my problem :)

                    – levesque
                    Nov 28 '11 at 20:50






                  • 1





                    I'm using Ubuntu 12.04 64 bit with gtk 2.0-0_2.24.10, and it failed on the dpkg-buildpackage line. It wouldn't build with uncommitted local changes, so I had to run dpkg-source --commit.

                    – Sam King
                    Aug 21 '12 at 14:54







                  • 1





                    @Sam: Thanks for the heads up. Apparently, the --source-option=--auto-commit option can be passed to dpkg-buildpackage (which is somewhat more convenient as one doesn't have to edit the change log). I've updated the guide to reflect this.

                    – Jelle Geerts
                    Aug 26 '12 at 23:40






                  • 1





                    I tried this solution, but every time I got to the sudo apt-get build-dep libgtk2.0-0 part I get an error with Picking 'gtk+2.0' as source package instead of 'libgtk2.0-0' E: Unable to find a source package for gtk+2.0 Help?

                    – FCTW
                    Jul 4 '13 at 17:38






                  • 1





                    @FCTW: I suspect the cause of the problem is that GTK3 has replaced GTK2 in modern distributions. Hence, you'll have to find the package name of the installed GTK3 library, by running a command like dpkg -l | grep libgtk. It's probably something like libgtk-3-0. I have verified my patch to work on early versions of GTK3; hopefully it still works.

                    – Jelle Geerts
                    Jul 12 '13 at 12:51













                  14












                  14








                  14







                  For a solution to the problem, please view this guide I wrote



                  Or, more directly, here's the patch to disable the 'middle mouse button paste' functionality in GTK.






                  share|improve this answer















                  For a solution to the problem, please view this guide I wrote



                  Or, more directly, here's the patch to disable the 'middle mouse button paste' functionality in GTK.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Mar 8 at 5:11









                  Pablo Bianchi

                  2,97021535




                  2,97021535










                  answered Sep 17 '11 at 21:27









                  Jelle GeertsJelle Geerts

                  28823




                  28823












                  • I haven't had the time to try it (partly because I no longer have a laptop), but this seems like the solution to my problem :)

                    – levesque
                    Nov 28 '11 at 20:50






                  • 1





                    I'm using Ubuntu 12.04 64 bit with gtk 2.0-0_2.24.10, and it failed on the dpkg-buildpackage line. It wouldn't build with uncommitted local changes, so I had to run dpkg-source --commit.

                    – Sam King
                    Aug 21 '12 at 14:54







                  • 1





                    @Sam: Thanks for the heads up. Apparently, the --source-option=--auto-commit option can be passed to dpkg-buildpackage (which is somewhat more convenient as one doesn't have to edit the change log). I've updated the guide to reflect this.

                    – Jelle Geerts
                    Aug 26 '12 at 23:40






                  • 1





                    I tried this solution, but every time I got to the sudo apt-get build-dep libgtk2.0-0 part I get an error with Picking 'gtk+2.0' as source package instead of 'libgtk2.0-0' E: Unable to find a source package for gtk+2.0 Help?

                    – FCTW
                    Jul 4 '13 at 17:38






                  • 1





                    @FCTW: I suspect the cause of the problem is that GTK3 has replaced GTK2 in modern distributions. Hence, you'll have to find the package name of the installed GTK3 library, by running a command like dpkg -l | grep libgtk. It's probably something like libgtk-3-0. I have verified my patch to work on early versions of GTK3; hopefully it still works.

                    – Jelle Geerts
                    Jul 12 '13 at 12:51

















                  • I haven't had the time to try it (partly because I no longer have a laptop), but this seems like the solution to my problem :)

                    – levesque
                    Nov 28 '11 at 20:50






                  • 1





                    I'm using Ubuntu 12.04 64 bit with gtk 2.0-0_2.24.10, and it failed on the dpkg-buildpackage line. It wouldn't build with uncommitted local changes, so I had to run dpkg-source --commit.

                    – Sam King
                    Aug 21 '12 at 14:54







                  • 1





                    @Sam: Thanks for the heads up. Apparently, the --source-option=--auto-commit option can be passed to dpkg-buildpackage (which is somewhat more convenient as one doesn't have to edit the change log). I've updated the guide to reflect this.

                    – Jelle Geerts
                    Aug 26 '12 at 23:40






                  • 1





                    I tried this solution, but every time I got to the sudo apt-get build-dep libgtk2.0-0 part I get an error with Picking 'gtk+2.0' as source package instead of 'libgtk2.0-0' E: Unable to find a source package for gtk+2.0 Help?

                    – FCTW
                    Jul 4 '13 at 17:38






                  • 1





                    @FCTW: I suspect the cause of the problem is that GTK3 has replaced GTK2 in modern distributions. Hence, you'll have to find the package name of the installed GTK3 library, by running a command like dpkg -l | grep libgtk. It's probably something like libgtk-3-0. I have verified my patch to work on early versions of GTK3; hopefully it still works.

                    – Jelle Geerts
                    Jul 12 '13 at 12:51
















                  I haven't had the time to try it (partly because I no longer have a laptop), but this seems like the solution to my problem :)

                  – levesque
                  Nov 28 '11 at 20:50





                  I haven't had the time to try it (partly because I no longer have a laptop), but this seems like the solution to my problem :)

                  – levesque
                  Nov 28 '11 at 20:50




                  1




                  1





                  I'm using Ubuntu 12.04 64 bit with gtk 2.0-0_2.24.10, and it failed on the dpkg-buildpackage line. It wouldn't build with uncommitted local changes, so I had to run dpkg-source --commit.

                  – Sam King
                  Aug 21 '12 at 14:54






                  I'm using Ubuntu 12.04 64 bit with gtk 2.0-0_2.24.10, and it failed on the dpkg-buildpackage line. It wouldn't build with uncommitted local changes, so I had to run dpkg-source --commit.

                  – Sam King
                  Aug 21 '12 at 14:54





                  1




                  1





                  @Sam: Thanks for the heads up. Apparently, the --source-option=--auto-commit option can be passed to dpkg-buildpackage (which is somewhat more convenient as one doesn't have to edit the change log). I've updated the guide to reflect this.

                  – Jelle Geerts
                  Aug 26 '12 at 23:40





                  @Sam: Thanks for the heads up. Apparently, the --source-option=--auto-commit option can be passed to dpkg-buildpackage (which is somewhat more convenient as one doesn't have to edit the change log). I've updated the guide to reflect this.

                  – Jelle Geerts
                  Aug 26 '12 at 23:40




                  1




                  1





                  I tried this solution, but every time I got to the sudo apt-get build-dep libgtk2.0-0 part I get an error with Picking 'gtk+2.0' as source package instead of 'libgtk2.0-0' E: Unable to find a source package for gtk+2.0 Help?

                  – FCTW
                  Jul 4 '13 at 17:38





                  I tried this solution, but every time I got to the sudo apt-get build-dep libgtk2.0-0 part I get an error with Picking 'gtk+2.0' as source package instead of 'libgtk2.0-0' E: Unable to find a source package for gtk+2.0 Help?

                  – FCTW
                  Jul 4 '13 at 17:38




                  1




                  1





                  @FCTW: I suspect the cause of the problem is that GTK3 has replaced GTK2 in modern distributions. Hence, you'll have to find the package name of the installed GTK3 library, by running a command like dpkg -l | grep libgtk. It's probably something like libgtk-3-0. I have verified my patch to work on early versions of GTK3; hopefully it still works.

                  – Jelle Geerts
                  Jul 12 '13 at 12:51





                  @FCTW: I suspect the cause of the problem is that GTK3 has replaced GTK2 in modern distributions. Hence, you'll have to find the package name of the installed GTK3 library, by running a command like dpkg -l | grep libgtk. It's probably something like libgtk-3-0. I have verified my patch to work on early versions of GTK3; hopefully it still works.

                  – Jelle Geerts
                  Jul 12 '13 at 12:51













                  31














                  Jared Robinson gave a simple solution that works on my machine:



                  Run the following command:



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


                  To persist this behavior, edit ~/.Xmodmap and add



                  pointer = 1 25 3 4 5 6 7 8 9





                  share|improve this answer




















                  • 23





                    Doesn't this just disable the middle button altogether? What about closing tabs, opening links to new tabs, etc.?

                    – levesque
                    Aug 7 '11 at 17:36






                  • 2





                    Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.

                    – Kris Harper
                    Sep 2 '11 at 17:02







                  • 19





                    @HDave How on earth should this be marked as the answer to a question that specifically states he's seen solutions that rebind the middle mouse to a different key, but those are not satisfactory? That's exactly what this answer does.

                    – Thor84no
                    Apr 2 '14 at 14:56






                  • 3





                    Can anyone provide an explanation as to what this series of magic numbers means?

                    – Neil Traft
                    Oct 6 '15 at 22:03






                  • 1





                    @Neil Traft I havent looked into this exact configuration too much but from my understanding of input event systems when you have an input device like a mouse, it sends back standard input events when buttons are pressed these events tell you that "a button changed state", "that button has id X", and "it current state is pressed/released" normally gtk modifies the input events it receives to map buttons ids [0,1,2,3,4,5,6,7,8] to [1,2,3,4,5,6,7,8,9] keep in mind only the first 3 button ids are used on most mice to indicate the button id for left, middle and right. so middle is now id 25

                    – S E
                    Nov 3 '15 at 14:09















                  31














                  Jared Robinson gave a simple solution that works on my machine:



                  Run the following command:



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


                  To persist this behavior, edit ~/.Xmodmap and add



                  pointer = 1 25 3 4 5 6 7 8 9





                  share|improve this answer




















                  • 23





                    Doesn't this just disable the middle button altogether? What about closing tabs, opening links to new tabs, etc.?

                    – levesque
                    Aug 7 '11 at 17:36






                  • 2





                    Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.

                    – Kris Harper
                    Sep 2 '11 at 17:02







                  • 19





                    @HDave How on earth should this be marked as the answer to a question that specifically states he's seen solutions that rebind the middle mouse to a different key, but those are not satisfactory? That's exactly what this answer does.

                    – Thor84no
                    Apr 2 '14 at 14:56






                  • 3





                    Can anyone provide an explanation as to what this series of magic numbers means?

                    – Neil Traft
                    Oct 6 '15 at 22:03






                  • 1





                    @Neil Traft I havent looked into this exact configuration too much but from my understanding of input event systems when you have an input device like a mouse, it sends back standard input events when buttons are pressed these events tell you that "a button changed state", "that button has id X", and "it current state is pressed/released" normally gtk modifies the input events it receives to map buttons ids [0,1,2,3,4,5,6,7,8] to [1,2,3,4,5,6,7,8,9] keep in mind only the first 3 button ids are used on most mice to indicate the button id for left, middle and right. so middle is now id 25

                    – S E
                    Nov 3 '15 at 14:09













                  31












                  31








                  31







                  Jared Robinson gave a simple solution that works on my machine:



                  Run the following command:



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


                  To persist this behavior, edit ~/.Xmodmap and add



                  pointer = 1 25 3 4 5 6 7 8 9





                  share|improve this answer















                  Jared Robinson gave a simple solution that works on my machine:



                  Run the following command:



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


                  To persist this behavior, edit ~/.Xmodmap and add



                  pointer = 1 25 3 4 5 6 7 8 9






                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Sep 5 '12 at 16:37









                  Tapper

                  1,8381212




                  1,8381212










                  answered Aug 6 '11 at 0:32









                  Jay GoldfarbJay Goldfarb

                  375132




                  375132







                  • 23





                    Doesn't this just disable the middle button altogether? What about closing tabs, opening links to new tabs, etc.?

                    – levesque
                    Aug 7 '11 at 17:36






                  • 2





                    Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.

                    – Kris Harper
                    Sep 2 '11 at 17:02







                  • 19





                    @HDave How on earth should this be marked as the answer to a question that specifically states he's seen solutions that rebind the middle mouse to a different key, but those are not satisfactory? That's exactly what this answer does.

                    – Thor84no
                    Apr 2 '14 at 14:56






                  • 3





                    Can anyone provide an explanation as to what this series of magic numbers means?

                    – Neil Traft
                    Oct 6 '15 at 22:03






                  • 1





                    @Neil Traft I havent looked into this exact configuration too much but from my understanding of input event systems when you have an input device like a mouse, it sends back standard input events when buttons are pressed these events tell you that "a button changed state", "that button has id X", and "it current state is pressed/released" normally gtk modifies the input events it receives to map buttons ids [0,1,2,3,4,5,6,7,8] to [1,2,3,4,5,6,7,8,9] keep in mind only the first 3 button ids are used on most mice to indicate the button id for left, middle and right. so middle is now id 25

                    – S E
                    Nov 3 '15 at 14:09












                  • 23





                    Doesn't this just disable the middle button altogether? What about closing tabs, opening links to new tabs, etc.?

                    – levesque
                    Aug 7 '11 at 17:36






                  • 2





                    Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.

                    – Kris Harper
                    Sep 2 '11 at 17:02







                  • 19





                    @HDave How on earth should this be marked as the answer to a question that specifically states he's seen solutions that rebind the middle mouse to a different key, but those are not satisfactory? That's exactly what this answer does.

                    – Thor84no
                    Apr 2 '14 at 14:56






                  • 3





                    Can anyone provide an explanation as to what this series of magic numbers means?

                    – Neil Traft
                    Oct 6 '15 at 22:03






                  • 1





                    @Neil Traft I havent looked into this exact configuration too much but from my understanding of input event systems when you have an input device like a mouse, it sends back standard input events when buttons are pressed these events tell you that "a button changed state", "that button has id X", and "it current state is pressed/released" normally gtk modifies the input events it receives to map buttons ids [0,1,2,3,4,5,6,7,8] to [1,2,3,4,5,6,7,8,9] keep in mind only the first 3 button ids are used on most mice to indicate the button id for left, middle and right. so middle is now id 25

                    – S E
                    Nov 3 '15 at 14:09







                  23




                  23





                  Doesn't this just disable the middle button altogether? What about closing tabs, opening links to new tabs, etc.?

                  – levesque
                  Aug 7 '11 at 17:36





                  Doesn't this just disable the middle button altogether? What about closing tabs, opening links to new tabs, etc.?

                  – levesque
                  Aug 7 '11 at 17:36




                  2




                  2





                  Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.

                  – Kris Harper
                  Sep 2 '11 at 17:02






                  Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.

                  – Kris Harper
                  Sep 2 '11 at 17:02





                  19




                  19





                  @HDave How on earth should this be marked as the answer to a question that specifically states he's seen solutions that rebind the middle mouse to a different key, but those are not satisfactory? That's exactly what this answer does.

                  – Thor84no
                  Apr 2 '14 at 14:56





                  @HDave How on earth should this be marked as the answer to a question that specifically states he's seen solutions that rebind the middle mouse to a different key, but those are not satisfactory? That's exactly what this answer does.

                  – Thor84no
                  Apr 2 '14 at 14:56




                  3




                  3





                  Can anyone provide an explanation as to what this series of magic numbers means?

                  – Neil Traft
                  Oct 6 '15 at 22:03





                  Can anyone provide an explanation as to what this series of magic numbers means?

                  – Neil Traft
                  Oct 6 '15 at 22:03




                  1




                  1





                  @Neil Traft I havent looked into this exact configuration too much but from my understanding of input event systems when you have an input device like a mouse, it sends back standard input events when buttons are pressed these events tell you that "a button changed state", "that button has id X", and "it current state is pressed/released" normally gtk modifies the input events it receives to map buttons ids [0,1,2,3,4,5,6,7,8] to [1,2,3,4,5,6,7,8,9] keep in mind only the first 3 button ids are used on most mice to indicate the button id for left, middle and right. so middle is now id 25

                  – S E
                  Nov 3 '15 at 14:09





                  @Neil Traft I havent looked into this exact configuration too much but from my understanding of input event systems when you have an input device like a mouse, it sends back standard input events when buttons are pressed these events tell you that "a button changed state", "that button has id X", and "it current state is pressed/released" normally gtk modifies the input events it receives to map buttons ids [0,1,2,3,4,5,6,7,8] to [1,2,3,4,5,6,7,8,9] keep in mind only the first 3 button ids are used on most mice to indicate the button id for left, middle and right. so middle is now id 25

                  – S E
                  Nov 3 '15 at 14:09











                  30














                  I use gnome-tweak-tool for disabling middle button paste in Ubuntu 16.04.




                  1. Install it



                    sudo apt install gnome-tweak-tool


                  2. Run it by searching "tweak tool" in installed apps or just type gnome-tweak-tool in a terminal.


                  3. Go to "Keyboard and mouse" -> "Middle-click paste"


                  4. Turn off.



                    screenshot



                  That's it.



                  Or using just CLI



                  gsettings set org.gnome.desktop.interface gtk-enable-primary-paste false


                  Tested on 16.04.






                  share|improve this answer




















                  • 1





                    Worked like a charm! I was losing hope so quickly. Thank you!

                    – theY4Kman
                    Feb 8 '17 at 19:43






                  • 2





                    it doesn't work after restart :'(

                    – Ahmad Muzakki
                    Apr 2 '17 at 5:55






                  • 1





                    Worked, of course! Why isn't this the top answer?

                    – CodeMouse92
                    Apr 19 '17 at 1:50






                  • 6





                    Using the Tweaks tool would be by far the nicest way to do this, if it worked. I switched off the middle-click paste and it is still middle-click pasting same as before. Same after a restart. Anyone solve a similar issue?

                    – Kvothe
                    Jul 25 '18 at 22:53






                  • 3





                    Also interesting, an explanation for the weird middle-click behaviour of overwriting the clipboard buffer with the current selection: askubuntu.com/a/225879/653860 (But sadly, disabling the middle mouse button altogether, as proposed in that answer, also disables my mouse wheel completely. It seems there is no simple way to get rid of this stupid behaviour without destroying other crucial input functionality. Very bad design... :/ )

                    – trollkotze
                    Jul 30 '18 at 14:56
















                  30














                  I use gnome-tweak-tool for disabling middle button paste in Ubuntu 16.04.




                  1. Install it



                    sudo apt install gnome-tweak-tool


                  2. Run it by searching "tweak tool" in installed apps or just type gnome-tweak-tool in a terminal.


                  3. Go to "Keyboard and mouse" -> "Middle-click paste"


                  4. Turn off.



                    screenshot



                  That's it.



                  Or using just CLI



                  gsettings set org.gnome.desktop.interface gtk-enable-primary-paste false


                  Tested on 16.04.






                  share|improve this answer




















                  • 1





                    Worked like a charm! I was losing hope so quickly. Thank you!

                    – theY4Kman
                    Feb 8 '17 at 19:43






                  • 2





                    it doesn't work after restart :'(

                    – Ahmad Muzakki
                    Apr 2 '17 at 5:55






                  • 1





                    Worked, of course! Why isn't this the top answer?

                    – CodeMouse92
                    Apr 19 '17 at 1:50






                  • 6





                    Using the Tweaks tool would be by far the nicest way to do this, if it worked. I switched off the middle-click paste and it is still middle-click pasting same as before. Same after a restart. Anyone solve a similar issue?

                    – Kvothe
                    Jul 25 '18 at 22:53






                  • 3





                    Also interesting, an explanation for the weird middle-click behaviour of overwriting the clipboard buffer with the current selection: askubuntu.com/a/225879/653860 (But sadly, disabling the middle mouse button altogether, as proposed in that answer, also disables my mouse wheel completely. It seems there is no simple way to get rid of this stupid behaviour without destroying other crucial input functionality. Very bad design... :/ )

                    – trollkotze
                    Jul 30 '18 at 14:56














                  30












                  30








                  30







                  I use gnome-tweak-tool for disabling middle button paste in Ubuntu 16.04.




                  1. Install it



                    sudo apt install gnome-tweak-tool


                  2. Run it by searching "tweak tool" in installed apps or just type gnome-tweak-tool in a terminal.


                  3. Go to "Keyboard and mouse" -> "Middle-click paste"


                  4. Turn off.



                    screenshot



                  That's it.



                  Or using just CLI



                  gsettings set org.gnome.desktop.interface gtk-enable-primary-paste false


                  Tested on 16.04.






                  share|improve this answer















                  I use gnome-tweak-tool for disabling middle button paste in Ubuntu 16.04.




                  1. Install it



                    sudo apt install gnome-tweak-tool


                  2. Run it by searching "tweak tool" in installed apps or just type gnome-tweak-tool in a terminal.


                  3. Go to "Keyboard and mouse" -> "Middle-click paste"


                  4. Turn off.



                    screenshot



                  That's it.



                  Or using just CLI



                  gsettings set org.gnome.desktop.interface gtk-enable-primary-paste false


                  Tested on 16.04.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited 14 mins ago









                  Dave Yarwood

                  1033




                  1033










                  answered Jan 15 '17 at 12:03









                  Sunny127Sunny127

                  43143




                  43143







                  • 1





                    Worked like a charm! I was losing hope so quickly. Thank you!

                    – theY4Kman
                    Feb 8 '17 at 19:43






                  • 2





                    it doesn't work after restart :'(

                    – Ahmad Muzakki
                    Apr 2 '17 at 5:55






                  • 1





                    Worked, of course! Why isn't this the top answer?

                    – CodeMouse92
                    Apr 19 '17 at 1:50






                  • 6





                    Using the Tweaks tool would be by far the nicest way to do this, if it worked. I switched off the middle-click paste and it is still middle-click pasting same as before. Same after a restart. Anyone solve a similar issue?

                    – Kvothe
                    Jul 25 '18 at 22:53






                  • 3





                    Also interesting, an explanation for the weird middle-click behaviour of overwriting the clipboard buffer with the current selection: askubuntu.com/a/225879/653860 (But sadly, disabling the middle mouse button altogether, as proposed in that answer, also disables my mouse wheel completely. It seems there is no simple way to get rid of this stupid behaviour without destroying other crucial input functionality. Very bad design... :/ )

                    – trollkotze
                    Jul 30 '18 at 14:56













                  • 1





                    Worked like a charm! I was losing hope so quickly. Thank you!

                    – theY4Kman
                    Feb 8 '17 at 19:43






                  • 2





                    it doesn't work after restart :'(

                    – Ahmad Muzakki
                    Apr 2 '17 at 5:55






                  • 1





                    Worked, of course! Why isn't this the top answer?

                    – CodeMouse92
                    Apr 19 '17 at 1:50






                  • 6





                    Using the Tweaks tool would be by far the nicest way to do this, if it worked. I switched off the middle-click paste and it is still middle-click pasting same as before. Same after a restart. Anyone solve a similar issue?

                    – Kvothe
                    Jul 25 '18 at 22:53






                  • 3





                    Also interesting, an explanation for the weird middle-click behaviour of overwriting the clipboard buffer with the current selection: askubuntu.com/a/225879/653860 (But sadly, disabling the middle mouse button altogether, as proposed in that answer, also disables my mouse wheel completely. It seems there is no simple way to get rid of this stupid behaviour without destroying other crucial input functionality. Very bad design... :/ )

                    – trollkotze
                    Jul 30 '18 at 14:56








                  1




                  1





                  Worked like a charm! I was losing hope so quickly. Thank you!

                  – theY4Kman
                  Feb 8 '17 at 19:43





                  Worked like a charm! I was losing hope so quickly. Thank you!

                  – theY4Kman
                  Feb 8 '17 at 19:43




                  2




                  2





                  it doesn't work after restart :'(

                  – Ahmad Muzakki
                  Apr 2 '17 at 5:55





                  it doesn't work after restart :'(

                  – Ahmad Muzakki
                  Apr 2 '17 at 5:55




                  1




                  1





                  Worked, of course! Why isn't this the top answer?

                  – CodeMouse92
                  Apr 19 '17 at 1:50





                  Worked, of course! Why isn't this the top answer?

                  – CodeMouse92
                  Apr 19 '17 at 1:50




                  6




                  6





                  Using the Tweaks tool would be by far the nicest way to do this, if it worked. I switched off the middle-click paste and it is still middle-click pasting same as before. Same after a restart. Anyone solve a similar issue?

                  – Kvothe
                  Jul 25 '18 at 22:53





                  Using the Tweaks tool would be by far the nicest way to do this, if it worked. I switched off the middle-click paste and it is still middle-click pasting same as before. Same after a restart. Anyone solve a similar issue?

                  – Kvothe
                  Jul 25 '18 at 22:53




                  3




                  3





                  Also interesting, an explanation for the weird middle-click behaviour of overwriting the clipboard buffer with the current selection: askubuntu.com/a/225879/653860 (But sadly, disabling the middle mouse button altogether, as proposed in that answer, also disables my mouse wheel completely. It seems there is no simple way to get rid of this stupid behaviour without destroying other crucial input functionality. Very bad design... :/ )

                  – trollkotze
                  Jul 30 '18 at 14:56






                  Also interesting, an explanation for the weird middle-click behaviour of overwriting the clipboard buffer with the current selection: askubuntu.com/a/225879/653860 (But sadly, disabling the middle mouse button altogether, as proposed in that answer, also disables my mouse wheel completely. It seems there is no simple way to get rid of this stupid behaviour without destroying other crucial input functionality. Very bad design... :/ )

                  – trollkotze
                  Jul 30 '18 at 14:56












                  26














                  I realise that this is not exactly the answer you want, but you can turn this off in Firefox (e.g. if you don't mind the feature elsewhere, but still want middle click in Firefox to open links in new tabs)



                  In about:config, set



                  middlemouse.contentLoadURL false
                  middlemouse.paste false


                  Not what you asked, but as this question is linked to from a few places I hope someone finds this answer useful.






                  share|improve this answer


















                  • 3





                    +1 That is helpful. I'll also add that in LibreOffice you can do this in Tools/Options/LibreOffice/View/Mouse change 'Middle mouse button' to your preferred setting.

                    – Tom Brossman
                    Oct 3 '12 at 10:30















                  26














                  I realise that this is not exactly the answer you want, but you can turn this off in Firefox (e.g. if you don't mind the feature elsewhere, but still want middle click in Firefox to open links in new tabs)



                  In about:config, set



                  middlemouse.contentLoadURL false
                  middlemouse.paste false


                  Not what you asked, but as this question is linked to from a few places I hope someone finds this answer useful.






                  share|improve this answer


















                  • 3





                    +1 That is helpful. I'll also add that in LibreOffice you can do this in Tools/Options/LibreOffice/View/Mouse change 'Middle mouse button' to your preferred setting.

                    – Tom Brossman
                    Oct 3 '12 at 10:30













                  26












                  26








                  26







                  I realise that this is not exactly the answer you want, but you can turn this off in Firefox (e.g. if you don't mind the feature elsewhere, but still want middle click in Firefox to open links in new tabs)



                  In about:config, set



                  middlemouse.contentLoadURL false
                  middlemouse.paste false


                  Not what you asked, but as this question is linked to from a few places I hope someone finds this answer useful.






                  share|improve this answer













                  I realise that this is not exactly the answer you want, but you can turn this off in Firefox (e.g. if you don't mind the feature elsewhere, but still want middle click in Firefox to open links in new tabs)



                  In about:config, set



                  middlemouse.contentLoadURL false
                  middlemouse.paste false


                  Not what you asked, but as this question is linked to from a few places I hope someone finds this answer useful.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Jan 21 '12 at 9:11









                  BenBen

                  26132




                  26132







                  • 3





                    +1 That is helpful. I'll also add that in LibreOffice you can do this in Tools/Options/LibreOffice/View/Mouse change 'Middle mouse button' to your preferred setting.

                    – Tom Brossman
                    Oct 3 '12 at 10:30












                  • 3





                    +1 That is helpful. I'll also add that in LibreOffice you can do this in Tools/Options/LibreOffice/View/Mouse change 'Middle mouse button' to your preferred setting.

                    – Tom Brossman
                    Oct 3 '12 at 10:30







                  3




                  3





                  +1 That is helpful. I'll also add that in LibreOffice you can do this in Tools/Options/LibreOffice/View/Mouse change 'Middle mouse button' to your preferred setting.

                  – Tom Brossman
                  Oct 3 '12 at 10:30





                  +1 That is helpful. I'll also add that in LibreOffice you can do this in Tools/Options/LibreOffice/View/Mouse change 'Middle mouse button' to your preferred setting.

                  – Tom Brossman
                  Oct 3 '12 at 10:30











                  21














                  This currently isn't possible - though, as you have mentioned, there are ways to disable the MOUSE 3 button - or remap it- none of those get at the source of the issue. The X11 Primary Selection.



                  While this isn't a solution, hopefully this explanation will make it clear WHY. In Ubuntu there are two clipboards at work. One, which everyone is familiar with, the freedesktop.org clipboard (captures Ctrl+C command) The second is a clipboard manager that has been at play since before Ubuntu even existed - X11. The X Server (X11) manages three other clipboards: Primary Selection, Secondary Selection, and Clipboard. When you select text with your pointer it gets copied to a buffer in the XServer, the Primary Selection, and awaits pasting by means of the Mouse 3 button. The other two were designed to be used by other applications in a means to share a common clipboard between applications. In this case the freedesktop.org clipboard manager in Ubuntu already does this for us.



                  Through the extent of my research I can not find a way to disable the X11 selection manager. There are no compilation flags, applications, or configuration values that can disable this. There are various ways around this on a per application basis (majority of these applications being command line ones) - but nothing on a global scale.



                  I realize this isn't an ideal solution - but seems to be the truth to the issue. The only relevant solution I could muster is actually a hack, create a script that executes an infinite while loop that just replaces the Primary Selection with a null value.



                  First install xsel (Tool for manipulation of the X selection) sudo apt-get install xsel



                  The code is as follows:



                  while(true)
                  do
                  echo -n | xsel -n -i
                  sleep 0.5
                  done


                  If you place this in a script and add it to your startup scripts this shouldn't be an issue.






                  share|improve this answer




















                  • 4





                    Any chance for a script that just clears the buffer instead of cancelling all selections?

                    – levesque
                    Oct 29 '10 at 20:16







                  • 2





                    while(true)? Looks like it will kill the CPU :)

                    – umpirsky
                    Jul 8 '11 at 10:54











                  • I've tried mapping butons by adding Option "ButtonMapping" "1 1 3 4 5" to xorg.conf, but the problem resists.

                    – umpirsky
                    Jul 8 '11 at 11:32






                  • 4





                    @umpirsky The while(true) is not a problem because the loop contains sleep 0.5 which relinquishes half a second of CPU time in each of the loop's iterations. Because of that (and the lightweightness of the xsel command invocation which comprises the other part of the loop), the CPU resources taken up by the loop will be exceedingly tiny even on the slowest of Ubuntu machines.

                    – Eliah Kagan
                    Nov 28 '11 at 7:16






                  • 4





                    This doesn't seem to work well on Unity because the script clears any existing selection in a terminal, which means you cannot copy test from a terminal by any means (by the time you try to copy, the text is unselected).

                    – Fantius
                    May 18 '12 at 18:45















                  21














                  This currently isn't possible - though, as you have mentioned, there are ways to disable the MOUSE 3 button - or remap it- none of those get at the source of the issue. The X11 Primary Selection.



                  While this isn't a solution, hopefully this explanation will make it clear WHY. In Ubuntu there are two clipboards at work. One, which everyone is familiar with, the freedesktop.org clipboard (captures Ctrl+C command) The second is a clipboard manager that has been at play since before Ubuntu even existed - X11. The X Server (X11) manages three other clipboards: Primary Selection, Secondary Selection, and Clipboard. When you select text with your pointer it gets copied to a buffer in the XServer, the Primary Selection, and awaits pasting by means of the Mouse 3 button. The other two were designed to be used by other applications in a means to share a common clipboard between applications. In this case the freedesktop.org clipboard manager in Ubuntu already does this for us.



                  Through the extent of my research I can not find a way to disable the X11 selection manager. There are no compilation flags, applications, or configuration values that can disable this. There are various ways around this on a per application basis (majority of these applications being command line ones) - but nothing on a global scale.



                  I realize this isn't an ideal solution - but seems to be the truth to the issue. The only relevant solution I could muster is actually a hack, create a script that executes an infinite while loop that just replaces the Primary Selection with a null value.



                  First install xsel (Tool for manipulation of the X selection) sudo apt-get install xsel



                  The code is as follows:



                  while(true)
                  do
                  echo -n | xsel -n -i
                  sleep 0.5
                  done


                  If you place this in a script and add it to your startup scripts this shouldn't be an issue.






                  share|improve this answer




















                  • 4





                    Any chance for a script that just clears the buffer instead of cancelling all selections?

                    – levesque
                    Oct 29 '10 at 20:16







                  • 2





                    while(true)? Looks like it will kill the CPU :)

                    – umpirsky
                    Jul 8 '11 at 10:54











                  • I've tried mapping butons by adding Option "ButtonMapping" "1 1 3 4 5" to xorg.conf, but the problem resists.

                    – umpirsky
                    Jul 8 '11 at 11:32






                  • 4





                    @umpirsky The while(true) is not a problem because the loop contains sleep 0.5 which relinquishes half a second of CPU time in each of the loop's iterations. Because of that (and the lightweightness of the xsel command invocation which comprises the other part of the loop), the CPU resources taken up by the loop will be exceedingly tiny even on the slowest of Ubuntu machines.

                    – Eliah Kagan
                    Nov 28 '11 at 7:16






                  • 4





                    This doesn't seem to work well on Unity because the script clears any existing selection in a terminal, which means you cannot copy test from a terminal by any means (by the time you try to copy, the text is unselected).

                    – Fantius
                    May 18 '12 at 18:45













                  21












                  21








                  21







                  This currently isn't possible - though, as you have mentioned, there are ways to disable the MOUSE 3 button - or remap it- none of those get at the source of the issue. The X11 Primary Selection.



                  While this isn't a solution, hopefully this explanation will make it clear WHY. In Ubuntu there are two clipboards at work. One, which everyone is familiar with, the freedesktop.org clipboard (captures Ctrl+C command) The second is a clipboard manager that has been at play since before Ubuntu even existed - X11. The X Server (X11) manages three other clipboards: Primary Selection, Secondary Selection, and Clipboard. When you select text with your pointer it gets copied to a buffer in the XServer, the Primary Selection, and awaits pasting by means of the Mouse 3 button. The other two were designed to be used by other applications in a means to share a common clipboard between applications. In this case the freedesktop.org clipboard manager in Ubuntu already does this for us.



                  Through the extent of my research I can not find a way to disable the X11 selection manager. There are no compilation flags, applications, or configuration values that can disable this. There are various ways around this on a per application basis (majority of these applications being command line ones) - but nothing on a global scale.



                  I realize this isn't an ideal solution - but seems to be the truth to the issue. The only relevant solution I could muster is actually a hack, create a script that executes an infinite while loop that just replaces the Primary Selection with a null value.



                  First install xsel (Tool for manipulation of the X selection) sudo apt-get install xsel



                  The code is as follows:



                  while(true)
                  do
                  echo -n | xsel -n -i
                  sleep 0.5
                  done


                  If you place this in a script and add it to your startup scripts this shouldn't be an issue.






                  share|improve this answer















                  This currently isn't possible - though, as you have mentioned, there are ways to disable the MOUSE 3 button - or remap it- none of those get at the source of the issue. The X11 Primary Selection.



                  While this isn't a solution, hopefully this explanation will make it clear WHY. In Ubuntu there are two clipboards at work. One, which everyone is familiar with, the freedesktop.org clipboard (captures Ctrl+C command) The second is a clipboard manager that has been at play since before Ubuntu even existed - X11. The X Server (X11) manages three other clipboards: Primary Selection, Secondary Selection, and Clipboard. When you select text with your pointer it gets copied to a buffer in the XServer, the Primary Selection, and awaits pasting by means of the Mouse 3 button. The other two were designed to be used by other applications in a means to share a common clipboard between applications. In this case the freedesktop.org clipboard manager in Ubuntu already does this for us.



                  Through the extent of my research I can not find a way to disable the X11 selection manager. There are no compilation flags, applications, or configuration values that can disable this. There are various ways around this on a per application basis (majority of these applications being command line ones) - but nothing on a global scale.



                  I realize this isn't an ideal solution - but seems to be the truth to the issue. The only relevant solution I could muster is actually a hack, create a script that executes an infinite while loop that just replaces the Primary Selection with a null value.



                  First install xsel (Tool for manipulation of the X selection) sudo apt-get install xsel



                  The code is as follows:



                  while(true)
                  do
                  echo -n | xsel -n -i
                  sleep 0.5
                  done


                  If you place this in a script and add it to your startup scripts this shouldn't be an issue.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Nov 9 '11 at 0:16









                  Community

                  1




                  1










                  answered Sep 23 '10 at 18:56









                  Marco CeppiMarco Ceppi

                  37.2k24154192




                  37.2k24154192







                  • 4





                    Any chance for a script that just clears the buffer instead of cancelling all selections?

                    – levesque
                    Oct 29 '10 at 20:16







                  • 2





                    while(true)? Looks like it will kill the CPU :)

                    – umpirsky
                    Jul 8 '11 at 10:54











                  • I've tried mapping butons by adding Option "ButtonMapping" "1 1 3 4 5" to xorg.conf, but the problem resists.

                    – umpirsky
                    Jul 8 '11 at 11:32






                  • 4





                    @umpirsky The while(true) is not a problem because the loop contains sleep 0.5 which relinquishes half a second of CPU time in each of the loop's iterations. Because of that (and the lightweightness of the xsel command invocation which comprises the other part of the loop), the CPU resources taken up by the loop will be exceedingly tiny even on the slowest of Ubuntu machines.

                    – Eliah Kagan
                    Nov 28 '11 at 7:16






                  • 4





                    This doesn't seem to work well on Unity because the script clears any existing selection in a terminal, which means you cannot copy test from a terminal by any means (by the time you try to copy, the text is unselected).

                    – Fantius
                    May 18 '12 at 18:45












                  • 4





                    Any chance for a script that just clears the buffer instead of cancelling all selections?

                    – levesque
                    Oct 29 '10 at 20:16







                  • 2





                    while(true)? Looks like it will kill the CPU :)

                    – umpirsky
                    Jul 8 '11 at 10:54











                  • I've tried mapping butons by adding Option "ButtonMapping" "1 1 3 4 5" to xorg.conf, but the problem resists.

                    – umpirsky
                    Jul 8 '11 at 11:32






                  • 4





                    @umpirsky The while(true) is not a problem because the loop contains sleep 0.5 which relinquishes half a second of CPU time in each of the loop's iterations. Because of that (and the lightweightness of the xsel command invocation which comprises the other part of the loop), the CPU resources taken up by the loop will be exceedingly tiny even on the slowest of Ubuntu machines.

                    – Eliah Kagan
                    Nov 28 '11 at 7:16






                  • 4





                    This doesn't seem to work well on Unity because the script clears any existing selection in a terminal, which means you cannot copy test from a terminal by any means (by the time you try to copy, the text is unselected).

                    – Fantius
                    May 18 '12 at 18:45







                  4




                  4





                  Any chance for a script that just clears the buffer instead of cancelling all selections?

                  – levesque
                  Oct 29 '10 at 20:16






                  Any chance for a script that just clears the buffer instead of cancelling all selections?

                  – levesque
                  Oct 29 '10 at 20:16





                  2




                  2





                  while(true)? Looks like it will kill the CPU :)

                  – umpirsky
                  Jul 8 '11 at 10:54





                  while(true)? Looks like it will kill the CPU :)

                  – umpirsky
                  Jul 8 '11 at 10:54













                  I've tried mapping butons by adding Option "ButtonMapping" "1 1 3 4 5" to xorg.conf, but the problem resists.

                  – umpirsky
                  Jul 8 '11 at 11:32





                  I've tried mapping butons by adding Option "ButtonMapping" "1 1 3 4 5" to xorg.conf, but the problem resists.

                  – umpirsky
                  Jul 8 '11 at 11:32




                  4




                  4





                  @umpirsky The while(true) is not a problem because the loop contains sleep 0.5 which relinquishes half a second of CPU time in each of the loop's iterations. Because of that (and the lightweightness of the xsel command invocation which comprises the other part of the loop), the CPU resources taken up by the loop will be exceedingly tiny even on the slowest of Ubuntu machines.

                  – Eliah Kagan
                  Nov 28 '11 at 7:16





                  @umpirsky The while(true) is not a problem because the loop contains sleep 0.5 which relinquishes half a second of CPU time in each of the loop's iterations. Because of that (and the lightweightness of the xsel command invocation which comprises the other part of the loop), the CPU resources taken up by the loop will be exceedingly tiny even on the slowest of Ubuntu machines.

                  – Eliah Kagan
                  Nov 28 '11 at 7:16




                  4




                  4





                  This doesn't seem to work well on Unity because the script clears any existing selection in a terminal, which means you cannot copy test from a terminal by any means (by the time you try to copy, the text is unselected).

                  – Fantius
                  May 18 '12 at 18:45





                  This doesn't seem to work well on Unity because the script clears any existing selection in a terminal, which means you cannot copy test from a terminal by any means (by the time you try to copy, the text is unselected).

                  – Fantius
                  May 18 '12 at 18:45











                  17














                  Somehow, I ended up without any xmodmap files on my Ubuntu install, so I had to find a different approach to this problem.



                  Take a look at the xinput command.



                  xinput list | grep -i mouse


                  which lists information about your mouse. It shows my mouse is "Dell Premium USB Optical Mouse" and also that I have "Macintosh mouse button emulation". Armed with that info, I can



                  xinput get-button-map "Dell Premium USB Optical Mouse"


                  which gives me a listing that looks like



                  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18


                  Here is the useful, required knowledge. My mouse has, theoretically, 18 buttons. Each button's default action has the same name as it's button number. In other words, button 1 does action 1, button 4 does action 4, etc. Action 0 means "off".



                  The position in the listing shows the function assigned to that button. So if my button map read



                  1 3 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 


                  this would mean button 1 (position 1) does action 1 (normal left button), button 2 (position 2) does action 3 (middle button) and button 3 (position 3) does action 2 (right button).



                  To make a left handed mouse all you would need would be a button map that starts



                  3 2 1 4 5 .....


                  Or, in your case, it looks like you want the middle button to do the same thing as button 1 (left button) so your map needs to start



                  1 1 3 ....


                  I'd reset my mouse button mappings thus:



                  xinput set-button-map "Dell Premium USB Optical Mouse" 1 1 3 5 6 6 7 8 9 10 11 12 13 14 15 16 17 18


                  In your case, you may have a different number of mapped buttons and have some special button map already defined. Likwely, your mouse has a different name, too. First, get your mouse's "name". Then, use the get-button-map operation to find your base button map. finally, use the set-button-map option, modifying button 2 to do action 1.



                  This is not a permanent change. I added the necessary code to my .bashrc so it executes every time I login or open a terminal.



                  Hope this helps.






                  share|improve this answer

























                  • Thanks for the info. It explains a little more about the mouse buttons and the actions applied to them. However, it isn't the solution I am looking for. If you left-click a tab in Chrome (to use my example) it selects it (if not selected already). Clicking it with the middle button, will close it (i.e. without clicking the X). I also miss middle-clicking a link to have it open in a new tab for later reading. I realise I can overcome these with alternatives but I am used to this way of working....

                    – neildeadman
                    Jan 12 '12 at 14:18











                  • Just a thought; any of the other buttons on your mouse, mine say I have 18 buttons though I have yet to physically find more than about 8 of them) may be the function you want. Try mapping other buttons to your third button and see if you find something useful.

                    – Wes Miller
                    Jan 13 '12 at 13:04






                  • 1





                    If you remap as a two button mouse, it shouldn't change the wheelfunction since the wheel rolls are pressing button 5 and 6 (or 7 and 8 or something like that).

                    – Wes Miller
                    Jan 13 '12 at 13:09











                  • I can confirm that this works on both the built in ThinkPad trackpoint and the Lenovo keyboard that has the same layout. The get-button-map on the Lenovo keyboard comes back with 22 buttons for me, but the same set-button-map <<name-or-id>> 1 0 3 approach works for me

                    – Milimetric
                    Aug 17 '15 at 14:44












                  • this is the answer (though I think your description is off) - get-button-map links the position in the list to the physical button, which is the opposite of xmodmap, which links the position in the list to the function. Using the set-button-map, we can map two physical buttons to one logical position. Works on an asus zenbook pro for me.

                    – zzzeek
                    Sep 7 '16 at 15:01















                  17














                  Somehow, I ended up without any xmodmap files on my Ubuntu install, so I had to find a different approach to this problem.



                  Take a look at the xinput command.



                  xinput list | grep -i mouse


                  which lists information about your mouse. It shows my mouse is "Dell Premium USB Optical Mouse" and also that I have "Macintosh mouse button emulation". Armed with that info, I can



                  xinput get-button-map "Dell Premium USB Optical Mouse"


                  which gives me a listing that looks like



                  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18


                  Here is the useful, required knowledge. My mouse has, theoretically, 18 buttons. Each button's default action has the same name as it's button number. In other words, button 1 does action 1, button 4 does action 4, etc. Action 0 means "off".



                  The position in the listing shows the function assigned to that button. So if my button map read



                  1 3 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 


                  this would mean button 1 (position 1) does action 1 (normal left button), button 2 (position 2) does action 3 (middle button) and button 3 (position 3) does action 2 (right button).



                  To make a left handed mouse all you would need would be a button map that starts



                  3 2 1 4 5 .....


                  Or, in your case, it looks like you want the middle button to do the same thing as button 1 (left button) so your map needs to start



                  1 1 3 ....


                  I'd reset my mouse button mappings thus:



                  xinput set-button-map "Dell Premium USB Optical Mouse" 1 1 3 5 6 6 7 8 9 10 11 12 13 14 15 16 17 18


                  In your case, you may have a different number of mapped buttons and have some special button map already defined. Likwely, your mouse has a different name, too. First, get your mouse's "name". Then, use the get-button-map operation to find your base button map. finally, use the set-button-map option, modifying button 2 to do action 1.



                  This is not a permanent change. I added the necessary code to my .bashrc so it executes every time I login or open a terminal.



                  Hope this helps.






                  share|improve this answer

























                  • Thanks for the info. It explains a little more about the mouse buttons and the actions applied to them. However, it isn't the solution I am looking for. If you left-click a tab in Chrome (to use my example) it selects it (if not selected already). Clicking it with the middle button, will close it (i.e. without clicking the X). I also miss middle-clicking a link to have it open in a new tab for later reading. I realise I can overcome these with alternatives but I am used to this way of working....

                    – neildeadman
                    Jan 12 '12 at 14:18











                  • Just a thought; any of the other buttons on your mouse, mine say I have 18 buttons though I have yet to physically find more than about 8 of them) may be the function you want. Try mapping other buttons to your third button and see if you find something useful.

                    – Wes Miller
                    Jan 13 '12 at 13:04






                  • 1





                    If you remap as a two button mouse, it shouldn't change the wheelfunction since the wheel rolls are pressing button 5 and 6 (or 7 and 8 or something like that).

                    – Wes Miller
                    Jan 13 '12 at 13:09











                  • I can confirm that this works on both the built in ThinkPad trackpoint and the Lenovo keyboard that has the same layout. The get-button-map on the Lenovo keyboard comes back with 22 buttons for me, but the same set-button-map <<name-or-id>> 1 0 3 approach works for me

                    – Milimetric
                    Aug 17 '15 at 14:44












                  • this is the answer (though I think your description is off) - get-button-map links the position in the list to the physical button, which is the opposite of xmodmap, which links the position in the list to the function. Using the set-button-map, we can map two physical buttons to one logical position. Works on an asus zenbook pro for me.

                    – zzzeek
                    Sep 7 '16 at 15:01













                  17












                  17








                  17







                  Somehow, I ended up without any xmodmap files on my Ubuntu install, so I had to find a different approach to this problem.



                  Take a look at the xinput command.



                  xinput list | grep -i mouse


                  which lists information about your mouse. It shows my mouse is "Dell Premium USB Optical Mouse" and also that I have "Macintosh mouse button emulation". Armed with that info, I can



                  xinput get-button-map "Dell Premium USB Optical Mouse"


                  which gives me a listing that looks like



                  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18


                  Here is the useful, required knowledge. My mouse has, theoretically, 18 buttons. Each button's default action has the same name as it's button number. In other words, button 1 does action 1, button 4 does action 4, etc. Action 0 means "off".



                  The position in the listing shows the function assigned to that button. So if my button map read



                  1 3 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 


                  this would mean button 1 (position 1) does action 1 (normal left button), button 2 (position 2) does action 3 (middle button) and button 3 (position 3) does action 2 (right button).



                  To make a left handed mouse all you would need would be a button map that starts



                  3 2 1 4 5 .....


                  Or, in your case, it looks like you want the middle button to do the same thing as button 1 (left button) so your map needs to start



                  1 1 3 ....


                  I'd reset my mouse button mappings thus:



                  xinput set-button-map "Dell Premium USB Optical Mouse" 1 1 3 5 6 6 7 8 9 10 11 12 13 14 15 16 17 18


                  In your case, you may have a different number of mapped buttons and have some special button map already defined. Likwely, your mouse has a different name, too. First, get your mouse's "name". Then, use the get-button-map operation to find your base button map. finally, use the set-button-map option, modifying button 2 to do action 1.



                  This is not a permanent change. I added the necessary code to my .bashrc so it executes every time I login or open a terminal.



                  Hope this helps.






                  share|improve this answer















                  Somehow, I ended up without any xmodmap files on my Ubuntu install, so I had to find a different approach to this problem.



                  Take a look at the xinput command.



                  xinput list | grep -i mouse


                  which lists information about your mouse. It shows my mouse is "Dell Premium USB Optical Mouse" and also that I have "Macintosh mouse button emulation". Armed with that info, I can



                  xinput get-button-map "Dell Premium USB Optical Mouse"


                  which gives me a listing that looks like



                  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18


                  Here is the useful, required knowledge. My mouse has, theoretically, 18 buttons. Each button's default action has the same name as it's button number. In other words, button 1 does action 1, button 4 does action 4, etc. Action 0 means "off".



                  The position in the listing shows the function assigned to that button. So if my button map read



                  1 3 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 


                  this would mean button 1 (position 1) does action 1 (normal left button), button 2 (position 2) does action 3 (middle button) and button 3 (position 3) does action 2 (right button).



                  To make a left handed mouse all you would need would be a button map that starts



                  3 2 1 4 5 .....


                  Or, in your case, it looks like you want the middle button to do the same thing as button 1 (left button) so your map needs to start



                  1 1 3 ....


                  I'd reset my mouse button mappings thus:



                  xinput set-button-map "Dell Premium USB Optical Mouse" 1 1 3 5 6 6 7 8 9 10 11 12 13 14 15 16 17 18


                  In your case, you may have a different number of mapped buttons and have some special button map already defined. Likwely, your mouse has a different name, too. First, get your mouse's "name". Then, use the get-button-map operation to find your base button map. finally, use the set-button-map option, modifying button 2 to do action 1.



                  This is not a permanent change. I added the necessary code to my .bashrc so it executes every time I login or open a terminal.



                  Hope this helps.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Jan 12 '12 at 14:16









                  neildeadman

                  252620




                  252620










                  answered Jan 12 '12 at 12:58









                  Wes MillerWes Miller

                  309413




                  309413












                  • Thanks for the info. It explains a little more about the mouse buttons and the actions applied to them. However, it isn't the solution I am looking for. If you left-click a tab in Chrome (to use my example) it selects it (if not selected already). Clicking it with the middle button, will close it (i.e. without clicking the X). I also miss middle-clicking a link to have it open in a new tab for later reading. I realise I can overcome these with alternatives but I am used to this way of working....

                    – neildeadman
                    Jan 12 '12 at 14:18











                  • Just a thought; any of the other buttons on your mouse, mine say I have 18 buttons though I have yet to physically find more than about 8 of them) may be the function you want. Try mapping other buttons to your third button and see if you find something useful.

                    – Wes Miller
                    Jan 13 '12 at 13:04






                  • 1





                    If you remap as a two button mouse, it shouldn't change the wheelfunction since the wheel rolls are pressing button 5 and 6 (or 7 and 8 or something like that).

                    – Wes Miller
                    Jan 13 '12 at 13:09











                  • I can confirm that this works on both the built in ThinkPad trackpoint and the Lenovo keyboard that has the same layout. The get-button-map on the Lenovo keyboard comes back with 22 buttons for me, but the same set-button-map <<name-or-id>> 1 0 3 approach works for me

                    – Milimetric
                    Aug 17 '15 at 14:44












                  • this is the answer (though I think your description is off) - get-button-map links the position in the list to the physical button, which is the opposite of xmodmap, which links the position in the list to the function. Using the set-button-map, we can map two physical buttons to one logical position. Works on an asus zenbook pro for me.

                    – zzzeek
                    Sep 7 '16 at 15:01

















                  • Thanks for the info. It explains a little more about the mouse buttons and the actions applied to them. However, it isn't the solution I am looking for. If you left-click a tab in Chrome (to use my example) it selects it (if not selected already). Clicking it with the middle button, will close it (i.e. without clicking the X). I also miss middle-clicking a link to have it open in a new tab for later reading. I realise I can overcome these with alternatives but I am used to this way of working....

                    – neildeadman
                    Jan 12 '12 at 14:18











                  • Just a thought; any of the other buttons on your mouse, mine say I have 18 buttons though I have yet to physically find more than about 8 of them) may be the function you want. Try mapping other buttons to your third button and see if you find something useful.

                    – Wes Miller
                    Jan 13 '12 at 13:04






                  • 1





                    If you remap as a two button mouse, it shouldn't change the wheelfunction since the wheel rolls are pressing button 5 and 6 (or 7 and 8 or something like that).

                    – Wes Miller
                    Jan 13 '12 at 13:09











                  • I can confirm that this works on both the built in ThinkPad trackpoint and the Lenovo keyboard that has the same layout. The get-button-map on the Lenovo keyboard comes back with 22 buttons for me, but the same set-button-map <<name-or-id>> 1 0 3 approach works for me

                    – Milimetric
                    Aug 17 '15 at 14:44












                  • this is the answer (though I think your description is off) - get-button-map links the position in the list to the physical button, which is the opposite of xmodmap, which links the position in the list to the function. Using the set-button-map, we can map two physical buttons to one logical position. Works on an asus zenbook pro for me.

                    – zzzeek
                    Sep 7 '16 at 15:01
















                  Thanks for the info. It explains a little more about the mouse buttons and the actions applied to them. However, it isn't the solution I am looking for. If you left-click a tab in Chrome (to use my example) it selects it (if not selected already). Clicking it with the middle button, will close it (i.e. without clicking the X). I also miss middle-clicking a link to have it open in a new tab for later reading. I realise I can overcome these with alternatives but I am used to this way of working....

                  – neildeadman
                  Jan 12 '12 at 14:18





                  Thanks for the info. It explains a little more about the mouse buttons and the actions applied to them. However, it isn't the solution I am looking for. If you left-click a tab in Chrome (to use my example) it selects it (if not selected already). Clicking it with the middle button, will close it (i.e. without clicking the X). I also miss middle-clicking a link to have it open in a new tab for later reading. I realise I can overcome these with alternatives but I am used to this way of working....

                  – neildeadman
                  Jan 12 '12 at 14:18













                  Just a thought; any of the other buttons on your mouse, mine say I have 18 buttons though I have yet to physically find more than about 8 of them) may be the function you want. Try mapping other buttons to your third button and see if you find something useful.

                  – Wes Miller
                  Jan 13 '12 at 13:04





                  Just a thought; any of the other buttons on your mouse, mine say I have 18 buttons though I have yet to physically find more than about 8 of them) may be the function you want. Try mapping other buttons to your third button and see if you find something useful.

                  – Wes Miller
                  Jan 13 '12 at 13:04




                  1




                  1





                  If you remap as a two button mouse, it shouldn't change the wheelfunction since the wheel rolls are pressing button 5 and 6 (or 7 and 8 or something like that).

                  – Wes Miller
                  Jan 13 '12 at 13:09





                  If you remap as a two button mouse, it shouldn't change the wheelfunction since the wheel rolls are pressing button 5 and 6 (or 7 and 8 or something like that).

                  – Wes Miller
                  Jan 13 '12 at 13:09













                  I can confirm that this works on both the built in ThinkPad trackpoint and the Lenovo keyboard that has the same layout. The get-button-map on the Lenovo keyboard comes back with 22 buttons for me, but the same set-button-map <<name-or-id>> 1 0 3 approach works for me

                  – Milimetric
                  Aug 17 '15 at 14:44






                  I can confirm that this works on both the built in ThinkPad trackpoint and the Lenovo keyboard that has the same layout. The get-button-map on the Lenovo keyboard comes back with 22 buttons for me, but the same set-button-map <<name-or-id>> 1 0 3 approach works for me

                  – Milimetric
                  Aug 17 '15 at 14:44














                  this is the answer (though I think your description is off) - get-button-map links the position in the list to the physical button, which is the opposite of xmodmap, which links the position in the list to the function. Using the set-button-map, we can map two physical buttons to one logical position. Works on an asus zenbook pro for me.

                  – zzzeek
                  Sep 7 '16 at 15:01





                  this is the answer (though I think your description is off) - get-button-map links the position in the list to the physical button, which is the opposite of xmodmap, which links the position in the list to the function. Using the set-button-map, we can map two physical buttons to one logical position. Works on an asus zenbook pro for me.

                  – zzzeek
                  Sep 7 '16 at 15:01











                  4














                  I suggest using one of these, which work mostly well for me:



                  using xbindkeys:
                  whenever middle-button is pressed, clear the primary clipboard. At least on my system it is cleared, before the pasting happens.
                  Details: create xbindkeys-config:



                  xbindkeys --defaults > $HOME/.xbindkeysrc


                  Paste the following new hotkey:



                  "xclip -i /dev/null" 
                  b:2``


                  Reload xbindkeys (e.g. killall xbindkeys;xbindkeys). Done.



                  using xdotool:
                  Clear the clipboard on window focus change (should work with most windowmanagers). Details:
                  Execute the following command:



                  xdotool search --onlyvisible . behave %@ focus exec xclip -i /dev/null


                  Note that with this command you can still use the primary clipboard within the same window, or pressing middlemouse onto another window BEFORE focusing it (if you don't have "focus follows mouse", or somthing, activated).






                  share|improve this answer



























                    4














                    I suggest using one of these, which work mostly well for me:



                    using xbindkeys:
                    whenever middle-button is pressed, clear the primary clipboard. At least on my system it is cleared, before the pasting happens.
                    Details: create xbindkeys-config:



                    xbindkeys --defaults > $HOME/.xbindkeysrc


                    Paste the following new hotkey:



                    "xclip -i /dev/null" 
                    b:2``


                    Reload xbindkeys (e.g. killall xbindkeys;xbindkeys). Done.



                    using xdotool:
                    Clear the clipboard on window focus change (should work with most windowmanagers). Details:
                    Execute the following command:



                    xdotool search --onlyvisible . behave %@ focus exec xclip -i /dev/null


                    Note that with this command you can still use the primary clipboard within the same window, or pressing middlemouse onto another window BEFORE focusing it (if you don't have "focus follows mouse", or somthing, activated).






                    share|improve this answer

























                      4












                      4








                      4







                      I suggest using one of these, which work mostly well for me:



                      using xbindkeys:
                      whenever middle-button is pressed, clear the primary clipboard. At least on my system it is cleared, before the pasting happens.
                      Details: create xbindkeys-config:



                      xbindkeys --defaults > $HOME/.xbindkeysrc


                      Paste the following new hotkey:



                      "xclip -i /dev/null" 
                      b:2``


                      Reload xbindkeys (e.g. killall xbindkeys;xbindkeys). Done.



                      using xdotool:
                      Clear the clipboard on window focus change (should work with most windowmanagers). Details:
                      Execute the following command:



                      xdotool search --onlyvisible . behave %@ focus exec xclip -i /dev/null


                      Note that with this command you can still use the primary clipboard within the same window, or pressing middlemouse onto another window BEFORE focusing it (if you don't have "focus follows mouse", or somthing, activated).






                      share|improve this answer













                      I suggest using one of these, which work mostly well for me:



                      using xbindkeys:
                      whenever middle-button is pressed, clear the primary clipboard. At least on my system it is cleared, before the pasting happens.
                      Details: create xbindkeys-config:



                      xbindkeys --defaults > $HOME/.xbindkeysrc


                      Paste the following new hotkey:



                      "xclip -i /dev/null" 
                      b:2``


                      Reload xbindkeys (e.g. killall xbindkeys;xbindkeys). Done.



                      using xdotool:
                      Clear the clipboard on window focus change (should work with most windowmanagers). Details:
                      Execute the following command:



                      xdotool search --onlyvisible . behave %@ focus exec xclip -i /dev/null


                      Note that with this command you can still use the primary clipboard within the same window, or pressing middlemouse onto another window BEFORE focusing it (if you don't have "focus follows mouse", or somthing, activated).







                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered Feb 22 '16 at 11:10









                      spawnspawn

                      412




                      412





















                          3














                          The best way I've found so far is to use EasyStroke, which can globally intercept middle-button click and allow to behave as middle button only in certain apps.



                          You can add a "group" in EasyStroke to apply this interception in multiple applications at once.
                          I've set to disable middle click in some of my text editors, IDE and MATLAB only and works as intended.



                          Reference:
                          http://ubuntuforums.org/showpost.php?p=11811126&postcount=25



                          Complete EasyStroke How-To:
                          http://sourceforge.net/apps/trac/easystroke/wiki/Documentation






                          share|improve this answer























                          • Thanks from the future for that tip. At first, I was going to just use xinput to disable it totally, and not need to run some extra program, but EasyStroke made it possible to set groups where I could disable the middle button for certain apps (my editor, mainly), and add gestures to certain other apps and using the middle button. So far, works well (14.04 Gnome fallback).

                            – Marty Fried
                            Aug 1 '15 at 18:30











                          • Added to my comment: after using EasyStroke for a while, I've found that it often fails to block the middle click. Since I haven't been using the gestures, I am abandoning this program for xinput.

                            – Marty Fried
                            Aug 19 '15 at 16:26















                          3














                          The best way I've found so far is to use EasyStroke, which can globally intercept middle-button click and allow to behave as middle button only in certain apps.



                          You can add a "group" in EasyStroke to apply this interception in multiple applications at once.
                          I've set to disable middle click in some of my text editors, IDE and MATLAB only and works as intended.



                          Reference:
                          http://ubuntuforums.org/showpost.php?p=11811126&postcount=25



                          Complete EasyStroke How-To:
                          http://sourceforge.net/apps/trac/easystroke/wiki/Documentation






                          share|improve this answer























                          • Thanks from the future for that tip. At first, I was going to just use xinput to disable it totally, and not need to run some extra program, but EasyStroke made it possible to set groups where I could disable the middle button for certain apps (my editor, mainly), and add gestures to certain other apps and using the middle button. So far, works well (14.04 Gnome fallback).

                            – Marty Fried
                            Aug 1 '15 at 18:30











                          • Added to my comment: after using EasyStroke for a while, I've found that it often fails to block the middle click. Since I haven't been using the gestures, I am abandoning this program for xinput.

                            – Marty Fried
                            Aug 19 '15 at 16:26













                          3












                          3








                          3







                          The best way I've found so far is to use EasyStroke, which can globally intercept middle-button click and allow to behave as middle button only in certain apps.



                          You can add a "group" in EasyStroke to apply this interception in multiple applications at once.
                          I've set to disable middle click in some of my text editors, IDE and MATLAB only and works as intended.



                          Reference:
                          http://ubuntuforums.org/showpost.php?p=11811126&postcount=25



                          Complete EasyStroke How-To:
                          http://sourceforge.net/apps/trac/easystroke/wiki/Documentation






                          share|improve this answer













                          The best way I've found so far is to use EasyStroke, which can globally intercept middle-button click and allow to behave as middle button only in certain apps.



                          You can add a "group" in EasyStroke to apply this interception in multiple applications at once.
                          I've set to disable middle click in some of my text editors, IDE and MATLAB only and works as intended.



                          Reference:
                          http://ubuntuforums.org/showpost.php?p=11811126&postcount=25



                          Complete EasyStroke How-To:
                          http://sourceforge.net/apps/trac/easystroke/wiki/Documentation







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Feb 3 '13 at 12:13









                          dbdqdbdq

                          392




                          392












                          • Thanks from the future for that tip. At first, I was going to just use xinput to disable it totally, and not need to run some extra program, but EasyStroke made it possible to set groups where I could disable the middle button for certain apps (my editor, mainly), and add gestures to certain other apps and using the middle button. So far, works well (14.04 Gnome fallback).

                            – Marty Fried
                            Aug 1 '15 at 18:30











                          • Added to my comment: after using EasyStroke for a while, I've found that it often fails to block the middle click. Since I haven't been using the gestures, I am abandoning this program for xinput.

                            – Marty Fried
                            Aug 19 '15 at 16:26

















                          • Thanks from the future for that tip. At first, I was going to just use xinput to disable it totally, and not need to run some extra program, but EasyStroke made it possible to set groups where I could disable the middle button for certain apps (my editor, mainly), and add gestures to certain other apps and using the middle button. So far, works well (14.04 Gnome fallback).

                            – Marty Fried
                            Aug 1 '15 at 18:30











                          • Added to my comment: after using EasyStroke for a while, I've found that it often fails to block the middle click. Since I haven't been using the gestures, I am abandoning this program for xinput.

                            – Marty Fried
                            Aug 19 '15 at 16:26
















                          Thanks from the future for that tip. At first, I was going to just use xinput to disable it totally, and not need to run some extra program, but EasyStroke made it possible to set groups where I could disable the middle button for certain apps (my editor, mainly), and add gestures to certain other apps and using the middle button. So far, works well (14.04 Gnome fallback).

                          – Marty Fried
                          Aug 1 '15 at 18:30





                          Thanks from the future for that tip. At first, I was going to just use xinput to disable it totally, and not need to run some extra program, but EasyStroke made it possible to set groups where I could disable the middle button for certain apps (my editor, mainly), and add gestures to certain other apps and using the middle button. So far, works well (14.04 Gnome fallback).

                          – Marty Fried
                          Aug 1 '15 at 18:30













                          Added to my comment: after using EasyStroke for a while, I've found that it often fails to block the middle click. Since I haven't been using the gestures, I am abandoning this program for xinput.

                          – Marty Fried
                          Aug 19 '15 at 16:26





                          Added to my comment: after using EasyStroke for a while, I've found that it often fails to block the middle click. Since I haven't been using the gestures, I am abandoning this program for xinput.

                          – Marty Fried
                          Aug 19 '15 at 16:26











                          2














                          This middle mouse button paste behavior is a feature of the X server (and gpm on the text console) and as far as I know at least X.org can't be configured to disable it - all you can do is to change the mapping of the physical mouse buttons as others already suggested.



                          Chances are good that you can configure your touchpad to avoid unwanted middle clicks, see gpointing-device-settings (not installed by default) or the synaptics manpage if you prefer to use your editor for configuration.






                          share|improve this answer



























                            2














                            This middle mouse button paste behavior is a feature of the X server (and gpm on the text console) and as far as I know at least X.org can't be configured to disable it - all you can do is to change the mapping of the physical mouse buttons as others already suggested.



                            Chances are good that you can configure your touchpad to avoid unwanted middle clicks, see gpointing-device-settings (not installed by default) or the synaptics manpage if you prefer to use your editor for configuration.






                            share|improve this answer

























                              2












                              2








                              2







                              This middle mouse button paste behavior is a feature of the X server (and gpm on the text console) and as far as I know at least X.org can't be configured to disable it - all you can do is to change the mapping of the physical mouse buttons as others already suggested.



                              Chances are good that you can configure your touchpad to avoid unwanted middle clicks, see gpointing-device-settings (not installed by default) or the synaptics manpage if you prefer to use your editor for configuration.






                              share|improve this answer













                              This middle mouse button paste behavior is a feature of the X server (and gpm on the text console) and as far as I know at least X.org can't be configured to disable it - all you can do is to change the mapping of the physical mouse buttons as others already suggested.



                              Chances are good that you can configure your touchpad to avoid unwanted middle clicks, see gpointing-device-settings (not installed by default) or the synaptics manpage if you prefer to use your editor for configuration.







                              share|improve this answer












                              share|improve this answer



                              share|improve this answer










                              answered Sep 23 '10 at 18:52









                              Florian DieschFlorian Diesch

                              65.7k16166181




                              65.7k16166181





















                                  2














                                  the link below fixed the problem for me.



                                  https://wiki.ubuntu.com/X/Config/Input#Example:_Disabling_middle-mouse_button_paste_on_a_scrollwheel_mouse



                                  the page refered by the above link has a section for how to disable the middle mouse paste on scrollwheel, by executing few commands the user can fetch the mouse buttons mapping and can also change the mapping.
                                  as explained in the page i disabled the the middle button by executing the command:



                                  $ xinput set-button-map 4 1 0 3





                                  share|improve this answer




















                                  • 4





                                    The OP specifically mentioned he did not want to completely disable the middle click button.

                                    – cpburnz
                                    Aug 25 '14 at 14:09















                                  2














                                  the link below fixed the problem for me.



                                  https://wiki.ubuntu.com/X/Config/Input#Example:_Disabling_middle-mouse_button_paste_on_a_scrollwheel_mouse



                                  the page refered by the above link has a section for how to disable the middle mouse paste on scrollwheel, by executing few commands the user can fetch the mouse buttons mapping and can also change the mapping.
                                  as explained in the page i disabled the the middle button by executing the command:



                                  $ xinput set-button-map 4 1 0 3





                                  share|improve this answer




















                                  • 4





                                    The OP specifically mentioned he did not want to completely disable the middle click button.

                                    – cpburnz
                                    Aug 25 '14 at 14:09













                                  2












                                  2








                                  2







                                  the link below fixed the problem for me.



                                  https://wiki.ubuntu.com/X/Config/Input#Example:_Disabling_middle-mouse_button_paste_on_a_scrollwheel_mouse



                                  the page refered by the above link has a section for how to disable the middle mouse paste on scrollwheel, by executing few commands the user can fetch the mouse buttons mapping and can also change the mapping.
                                  as explained in the page i disabled the the middle button by executing the command:



                                  $ xinput set-button-map 4 1 0 3





                                  share|improve this answer















                                  the link below fixed the problem for me.



                                  https://wiki.ubuntu.com/X/Config/Input#Example:_Disabling_middle-mouse_button_paste_on_a_scrollwheel_mouse



                                  the page refered by the above link has a section for how to disable the middle mouse paste on scrollwheel, by executing few commands the user can fetch the mouse buttons mapping and can also change the mapping.
                                  as explained in the page i disabled the the middle button by executing the command:



                                  $ xinput set-button-map 4 1 0 3






                                  share|improve this answer














                                  share|improve this answer



                                  share|improve this answer








                                  edited May 22 '14 at 8:43

























                                  answered Jan 5 '14 at 14:38









                                  Ahmad BawanehAhmad Bawaneh

                                  376




                                  376







                                  • 4





                                    The OP specifically mentioned he did not want to completely disable the middle click button.

                                    – cpburnz
                                    Aug 25 '14 at 14:09












                                  • 4





                                    The OP specifically mentioned he did not want to completely disable the middle click button.

                                    – cpburnz
                                    Aug 25 '14 at 14:09







                                  4




                                  4





                                  The OP specifically mentioned he did not want to completely disable the middle click button.

                                  – cpburnz
                                  Aug 25 '14 at 14:09





                                  The OP specifically mentioned he did not want to completely disable the middle click button.

                                  – cpburnz
                                  Aug 25 '14 at 14:09











                                  2














                                  Here's the simplest solution I've found to keep middle click functional without it pasting things.



                                  First install sxhkd and xsel.



                                  Then configure ./.config/.sxhkd/sxhkdrc like so



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


                                  And that's basically it.



                                  Now start sxhkd (or configure it to launch on startup). Now, middle mouse will no longer paste anything but will otherwise function like normal. (As long as you use only ctrl+c and ctrl+x to copy things that is, if you copy things with the mouse it can paste once before it returns to normal.)






                                  share|improve this answer





























                                    2














                                    Here's the simplest solution I've found to keep middle click functional without it pasting things.



                                    First install sxhkd and xsel.



                                    Then configure ./.config/.sxhkd/sxhkdrc like so



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


                                    And that's basically it.



                                    Now start sxhkd (or configure it to launch on startup). Now, middle mouse will no longer paste anything but will otherwise function like normal. (As long as you use only ctrl+c and ctrl+x to copy things that is, if you copy things with the mouse it can paste once before it returns to normal.)






                                    share|improve this answer



























                                      2












                                      2








                                      2







                                      Here's the simplest solution I've found to keep middle click functional without it pasting things.



                                      First install sxhkd and xsel.



                                      Then configure ./.config/.sxhkd/sxhkdrc like so



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


                                      And that's basically it.



                                      Now start sxhkd (or configure it to launch on startup). Now, middle mouse will no longer paste anything but will otherwise function like normal. (As long as you use only ctrl+c and ctrl+x to copy things that is, if you copy things with the mouse it can paste once before it returns to normal.)






                                      share|improve this answer















                                      Here's the simplest solution I've found to keep middle click functional without it pasting things.



                                      First install sxhkd and xsel.



                                      Then configure ./.config/.sxhkd/sxhkdrc like so



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


                                      And that's basically it.



                                      Now start sxhkd (or configure it to launch on startup). Now, middle mouse will no longer paste anything but will otherwise function like normal. (As long as you use only ctrl+c and ctrl+x to copy things that is, if you copy things with the mouse it can paste once before it returns to normal.)







                                      share|improve this answer














                                      share|improve this answer



                                      share|improve this answer








                                      edited Oct 1 '18 at 14:08

























                                      answered Sep 30 '18 at 22:02









                                      CestarianCestarian

                                      1415




                                      1415





















                                          1














                                          I had the same problem a few months ago and I solved it by changing the mouse! But, as you, I was frustrated that simple button mapping problem can't be solved elegantly by a software fix. Fortunately, I had the problem on my job computer, and my employer owns a variety of spare mouse controllers. It was a no cost fix!



                                          I think a proper mouse hardware implementation should not send random middle clicks while scrolling. Recently I found this behaviour to get annoying even while using Windows!



                                          Now that I've fixed the hardware bug with the proper hardware solution (change the mouse) I even started an addiction to "paste on middle-click" behaviour!!



                                          Happy linuxing!



                                          Sincerly,






                                          share|improve this answer



























                                            1














                                            I had the same problem a few months ago and I solved it by changing the mouse! But, as you, I was frustrated that simple button mapping problem can't be solved elegantly by a software fix. Fortunately, I had the problem on my job computer, and my employer owns a variety of spare mouse controllers. It was a no cost fix!



                                            I think a proper mouse hardware implementation should not send random middle clicks while scrolling. Recently I found this behaviour to get annoying even while using Windows!



                                            Now that I've fixed the hardware bug with the proper hardware solution (change the mouse) I even started an addiction to "paste on middle-click" behaviour!!



                                            Happy linuxing!



                                            Sincerly,






                                            share|improve this answer

























                                              1












                                              1








                                              1







                                              I had the same problem a few months ago and I solved it by changing the mouse! But, as you, I was frustrated that simple button mapping problem can't be solved elegantly by a software fix. Fortunately, I had the problem on my job computer, and my employer owns a variety of spare mouse controllers. It was a no cost fix!



                                              I think a proper mouse hardware implementation should not send random middle clicks while scrolling. Recently I found this behaviour to get annoying even while using Windows!



                                              Now that I've fixed the hardware bug with the proper hardware solution (change the mouse) I even started an addiction to "paste on middle-click" behaviour!!



                                              Happy linuxing!



                                              Sincerly,






                                              share|improve this answer













                                              I had the same problem a few months ago and I solved it by changing the mouse! But, as you, I was frustrated that simple button mapping problem can't be solved elegantly by a software fix. Fortunately, I had the problem on my job computer, and my employer owns a variety of spare mouse controllers. It was a no cost fix!



                                              I think a proper mouse hardware implementation should not send random middle clicks while scrolling. Recently I found this behaviour to get annoying even while using Windows!



                                              Now that I've fixed the hardware bug with the proper hardware solution (change the mouse) I even started an addiction to "paste on middle-click" behaviour!!



                                              Happy linuxing!



                                              Sincerly,







                                              share|improve this answer












                                              share|improve this answer



                                              share|improve this answer










                                              answered Aug 16 '12 at 18:44









                                              JonathanJonathan

                                              191




                                              191





















                                                  1














                                                  SW:
                                                  Ubuntu 14.04, with Gnome fall back.
                                                  HW: I have a laptop and so the middle button is actually the mouse on/in the laptop.
                                                  Solution:
                                                  Go to Ubuntu SW center and download Unity Tweak Tool.
                                                  Start Tweak Tool. Under the Mouse settings it has switch to turn on/off the middle click insert.
                                                  Have a lovely day.






                                                  share|improve this answer























                                                  • I have the same system. I downloaded Unity Tweak Tool and wasted time looking at every setting, but there was no such setting. Perhaps you meant "Tweak Tool", which is, I think, Gnome Tweak Tool. It has a setting, although it doesn't seem to work.

                                                    – Marty Fried
                                                    Aug 1 '15 at 16:42















                                                  1














                                                  SW:
                                                  Ubuntu 14.04, with Gnome fall back.
                                                  HW: I have a laptop and so the middle button is actually the mouse on/in the laptop.
                                                  Solution:
                                                  Go to Ubuntu SW center and download Unity Tweak Tool.
                                                  Start Tweak Tool. Under the Mouse settings it has switch to turn on/off the middle click insert.
                                                  Have a lovely day.






                                                  share|improve this answer























                                                  • I have the same system. I downloaded Unity Tweak Tool and wasted time looking at every setting, but there was no such setting. Perhaps you meant "Tweak Tool", which is, I think, Gnome Tweak Tool. It has a setting, although it doesn't seem to work.

                                                    – Marty Fried
                                                    Aug 1 '15 at 16:42













                                                  1












                                                  1








                                                  1







                                                  SW:
                                                  Ubuntu 14.04, with Gnome fall back.
                                                  HW: I have a laptop and so the middle button is actually the mouse on/in the laptop.
                                                  Solution:
                                                  Go to Ubuntu SW center and download Unity Tweak Tool.
                                                  Start Tweak Tool. Under the Mouse settings it has switch to turn on/off the middle click insert.
                                                  Have a lovely day.






                                                  share|improve this answer













                                                  SW:
                                                  Ubuntu 14.04, with Gnome fall back.
                                                  HW: I have a laptop and so the middle button is actually the mouse on/in the laptop.
                                                  Solution:
                                                  Go to Ubuntu SW center and download Unity Tweak Tool.
                                                  Start Tweak Tool. Under the Mouse settings it has switch to turn on/off the middle click insert.
                                                  Have a lovely day.







                                                  share|improve this answer












                                                  share|improve this answer



                                                  share|improve this answer










                                                  answered Sep 11 '14 at 23:32









                                                  user2712329user2712329

                                                  2916




                                                  2916












                                                  • I have the same system. I downloaded Unity Tweak Tool and wasted time looking at every setting, but there was no such setting. Perhaps you meant "Tweak Tool", which is, I think, Gnome Tweak Tool. It has a setting, although it doesn't seem to work.

                                                    – Marty Fried
                                                    Aug 1 '15 at 16:42

















                                                  • I have the same system. I downloaded Unity Tweak Tool and wasted time looking at every setting, but there was no such setting. Perhaps you meant "Tweak Tool", which is, I think, Gnome Tweak Tool. It has a setting, although it doesn't seem to work.

                                                    – Marty Fried
                                                    Aug 1 '15 at 16:42
















                                                  I have the same system. I downloaded Unity Tweak Tool and wasted time looking at every setting, but there was no such setting. Perhaps you meant "Tweak Tool", which is, I think, Gnome Tweak Tool. It has a setting, although it doesn't seem to work.

                                                  – Marty Fried
                                                  Aug 1 '15 at 16:42





                                                  I have the same system. I downloaded Unity Tweak Tool and wasted time looking at every setting, but there was no such setting. Perhaps you meant "Tweak Tool", which is, I think, Gnome Tweak Tool. It has a setting, although it doesn't seem to work.

                                                  – Marty Fried
                                                  Aug 1 '15 at 16:42











                                                  1














                                                  I tried the xinput-redirection trick, changing the center mouse "button" (actually a wheel) so it acts just like the left mouse button. It still works as a wheel, and has (apparently) stopped pasting things into random places in the middle of my source code as I scroll past.



                                                  In my case the command was



                                                  xinput set-button-map "PixArt USB Optical Mouse" 1 1 3 4 5 6 7 8 9 10 11 12 13 14 15 16


                                                  but YMMV by mouse model.






                                                  share|improve this answer





























                                                    1














                                                    I tried the xinput-redirection trick, changing the center mouse "button" (actually a wheel) so it acts just like the left mouse button. It still works as a wheel, and has (apparently) stopped pasting things into random places in the middle of my source code as I scroll past.



                                                    In my case the command was



                                                    xinput set-button-map "PixArt USB Optical Mouse" 1 1 3 4 5 6 7 8 9 10 11 12 13 14 15 16


                                                    but YMMV by mouse model.






                                                    share|improve this answer



























                                                      1












                                                      1








                                                      1







                                                      I tried the xinput-redirection trick, changing the center mouse "button" (actually a wheel) so it acts just like the left mouse button. It still works as a wheel, and has (apparently) stopped pasting things into random places in the middle of my source code as I scroll past.



                                                      In my case the command was



                                                      xinput set-button-map "PixArt USB Optical Mouse" 1 1 3 4 5 6 7 8 9 10 11 12 13 14 15 16


                                                      but YMMV by mouse model.






                                                      share|improve this answer















                                                      I tried the xinput-redirection trick, changing the center mouse "button" (actually a wheel) so it acts just like the left mouse button. It still works as a wheel, and has (apparently) stopped pasting things into random places in the middle of my source code as I scroll past.



                                                      In my case the command was



                                                      xinput set-button-map "PixArt USB Optical Mouse" 1 1 3 4 5 6 7 8 9 10 11 12 13 14 15 16


                                                      but YMMV by mouse model.







                                                      share|improve this answer














                                                      share|improve this answer



                                                      share|improve this answer








                                                      edited Dec 3 '14 at 21:55









                                                      muru

                                                      1




                                                      1










                                                      answered Dec 3 '14 at 20:13









                                                      Stephen BlochStephen Bloch

                                                      111




                                                      111





















                                                          1














                                                          I may have a partial answer for you, if you are using a lenovo X... with
                                                          touchpoint/touchpad.
                                                          There is a "known" bug with the synaptics mouse buttons. If you try a USB mouse
                                                          and have no problem, but with the touchpad/touchpoint mouse (build into the keyboard) you do have random responses that can delete swaths of text as you type, then this may be the bug I'm talking about.



                                                          https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1506817



                                                          If this fits your situation, then add your name to the list of people who have identified this bug, at that bug report. Maybe if there are many more of us reporting this, it would get fixed.






                                                          share|improve this answer



























                                                            1














                                                            I may have a partial answer for you, if you are using a lenovo X... with
                                                            touchpoint/touchpad.
                                                            There is a "known" bug with the synaptics mouse buttons. If you try a USB mouse
                                                            and have no problem, but with the touchpad/touchpoint mouse (build into the keyboard) you do have random responses that can delete swaths of text as you type, then this may be the bug I'm talking about.



                                                            https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1506817



                                                            If this fits your situation, then add your name to the list of people who have identified this bug, at that bug report. Maybe if there are many more of us reporting this, it would get fixed.






                                                            share|improve this answer

























                                                              1












                                                              1








                                                              1







                                                              I may have a partial answer for you, if you are using a lenovo X... with
                                                              touchpoint/touchpad.
                                                              There is a "known" bug with the synaptics mouse buttons. If you try a USB mouse
                                                              and have no problem, but with the touchpad/touchpoint mouse (build into the keyboard) you do have random responses that can delete swaths of text as you type, then this may be the bug I'm talking about.



                                                              https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1506817



                                                              If this fits your situation, then add your name to the list of people who have identified this bug, at that bug report. Maybe if there are many more of us reporting this, it would get fixed.






                                                              share|improve this answer













                                                              I may have a partial answer for you, if you are using a lenovo X... with
                                                              touchpoint/touchpad.
                                                              There is a "known" bug with the synaptics mouse buttons. If you try a USB mouse
                                                              and have no problem, but with the touchpad/touchpoint mouse (build into the keyboard) you do have random responses that can delete swaths of text as you type, then this may be the bug I'm talking about.



                                                              https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1506817



                                                              If this fits your situation, then add your name to the list of people who have identified this bug, at that bug report. Maybe if there are many more of us reporting this, it would get fixed.







                                                              share|improve this answer












                                                              share|improve this answer



                                                              share|improve this answer










                                                              answered Jul 14 '16 at 23:19









                                                              Jont AllenJont Allen

                                                              294




                                                              294





















                                                                  0














                                                                  It's more than a gnome feature, i think it works almost everywhere, it works in the console too, and I think it worked even in my "Linux from Scratch".



                                                                  So it's really a basic feature perhaps even somewhere in the kernel.



                                                                  BTW: It's really useful, and it's not the regular paste like Ctrl + V, everything that is marked with the cursor goes in a second storage and with middleclick can paste, what you marked last.






                                                                  share|improve this answer


















                                                                  • 1





                                                                    BTW2: It pastes where you click, not where the Text cursor is.

                                                                    – phiphi
                                                                    Sep 23 '10 at 18:13






                                                                  • 1





                                                                    It's great that you have that opinion, but that's not what the OP was asking!

                                                                    – Matt Fletcher
                                                                    Sep 13 '13 at 9:55















                                                                  0














                                                                  It's more than a gnome feature, i think it works almost everywhere, it works in the console too, and I think it worked even in my "Linux from Scratch".



                                                                  So it's really a basic feature perhaps even somewhere in the kernel.



                                                                  BTW: It's really useful, and it's not the regular paste like Ctrl + V, everything that is marked with the cursor goes in a second storage and with middleclick can paste, what you marked last.






                                                                  share|improve this answer


















                                                                  • 1





                                                                    BTW2: It pastes where you click, not where the Text cursor is.

                                                                    – phiphi
                                                                    Sep 23 '10 at 18:13






                                                                  • 1





                                                                    It's great that you have that opinion, but that's not what the OP was asking!

                                                                    – Matt Fletcher
                                                                    Sep 13 '13 at 9:55













                                                                  0












                                                                  0








                                                                  0







                                                                  It's more than a gnome feature, i think it works almost everywhere, it works in the console too, and I think it worked even in my "Linux from Scratch".



                                                                  So it's really a basic feature perhaps even somewhere in the kernel.



                                                                  BTW: It's really useful, and it's not the regular paste like Ctrl + V, everything that is marked with the cursor goes in a second storage and with middleclick can paste, what you marked last.






                                                                  share|improve this answer













                                                                  It's more than a gnome feature, i think it works almost everywhere, it works in the console too, and I think it worked even in my "Linux from Scratch".



                                                                  So it's really a basic feature perhaps even somewhere in the kernel.



                                                                  BTW: It's really useful, and it's not the regular paste like Ctrl + V, everything that is marked with the cursor goes in a second storage and with middleclick can paste, what you marked last.







                                                                  share|improve this answer












                                                                  share|improve this answer



                                                                  share|improve this answer










                                                                  answered Sep 23 '10 at 18:08









                                                                  phiphiphiphi

                                                                  21




                                                                  21







                                                                  • 1





                                                                    BTW2: It pastes where you click, not where the Text cursor is.

                                                                    – phiphi
                                                                    Sep 23 '10 at 18:13






                                                                  • 1





                                                                    It's great that you have that opinion, but that's not what the OP was asking!

                                                                    – Matt Fletcher
                                                                    Sep 13 '13 at 9:55












                                                                  • 1





                                                                    BTW2: It pastes where you click, not where the Text cursor is.

                                                                    – phiphi
                                                                    Sep 23 '10 at 18:13






                                                                  • 1





                                                                    It's great that you have that opinion, but that's not what the OP was asking!

                                                                    – Matt Fletcher
                                                                    Sep 13 '13 at 9:55







                                                                  1




                                                                  1





                                                                  BTW2: It pastes where you click, not where the Text cursor is.

                                                                  – phiphi
                                                                  Sep 23 '10 at 18:13





                                                                  BTW2: It pastes where you click, not where the Text cursor is.

                                                                  – phiphi
                                                                  Sep 23 '10 at 18:13




                                                                  1




                                                                  1





                                                                  It's great that you have that opinion, but that's not what the OP was asking!

                                                                  – Matt Fletcher
                                                                  Sep 13 '13 at 9:55





                                                                  It's great that you have that opinion, but that's not what the OP was asking!

                                                                  – Matt Fletcher
                                                                  Sep 13 '13 at 9:55











                                                                  0














                                                                  Using what I learned in the posts above, this bash one-liner works perfectly for me...



                                                                  mouse_id=$(xinput list | grep 'Mouse' | awk 'print $9' | sed 's/[^0-9]//g') && xinput set-button-map "$mouse_id" 1 0 3





                                                                  share|improve this answer


















                                                                  • 1





                                                                    The OP specifically mentioned he did not want to completely disable the middle click button.

                                                                    – cpburnz
                                                                    Aug 25 '14 at 14:10











                                                                  • I modified your one-liner to support multiple mice: xinput list | grep 'Mouse' | grep -o 'id=[0-9]*' | grep -o '[0-9]*' | xargs -i xinput set-button-map "" 1 0 3

                                                                    – Kurt
                                                                    Oct 23 '18 at 21:04















                                                                  0














                                                                  Using what I learned in the posts above, this bash one-liner works perfectly for me...



                                                                  mouse_id=$(xinput list | grep 'Mouse' | awk 'print $9' | sed 's/[^0-9]//g') && xinput set-button-map "$mouse_id" 1 0 3





                                                                  share|improve this answer


















                                                                  • 1





                                                                    The OP specifically mentioned he did not want to completely disable the middle click button.

                                                                    – cpburnz
                                                                    Aug 25 '14 at 14:10











                                                                  • I modified your one-liner to support multiple mice: xinput list | grep 'Mouse' | grep -o 'id=[0-9]*' | grep -o '[0-9]*' | xargs -i xinput set-button-map "" 1 0 3

                                                                    – Kurt
                                                                    Oct 23 '18 at 21:04













                                                                  0












                                                                  0








                                                                  0







                                                                  Using what I learned in the posts above, this bash one-liner works perfectly for me...



                                                                  mouse_id=$(xinput list | grep 'Mouse' | awk 'print $9' | sed 's/[^0-9]//g') && xinput set-button-map "$mouse_id" 1 0 3





                                                                  share|improve this answer













                                                                  Using what I learned in the posts above, this bash one-liner works perfectly for me...



                                                                  mouse_id=$(xinput list | grep 'Mouse' | awk 'print $9' | sed 's/[^0-9]//g') && xinput set-button-map "$mouse_id" 1 0 3






                                                                  share|improve this answer












                                                                  share|improve this answer



                                                                  share|improve this answer










                                                                  answered Dec 4 '13 at 16:42









                                                                  ScottScott

                                                                  1111




                                                                  1111







                                                                  • 1





                                                                    The OP specifically mentioned he did not want to completely disable the middle click button.

                                                                    – cpburnz
                                                                    Aug 25 '14 at 14:10











                                                                  • I modified your one-liner to support multiple mice: xinput list | grep 'Mouse' | grep -o 'id=[0-9]*' | grep -o '[0-9]*' | xargs -i xinput set-button-map "" 1 0 3

                                                                    – Kurt
                                                                    Oct 23 '18 at 21:04












                                                                  • 1





                                                                    The OP specifically mentioned he did not want to completely disable the middle click button.

                                                                    – cpburnz
                                                                    Aug 25 '14 at 14:10











                                                                  • I modified your one-liner to support multiple mice: xinput list | grep 'Mouse' | grep -o 'id=[0-9]*' | grep -o '[0-9]*' | xargs -i xinput set-button-map "" 1 0 3

                                                                    – Kurt
                                                                    Oct 23 '18 at 21:04







                                                                  1




                                                                  1





                                                                  The OP specifically mentioned he did not want to completely disable the middle click button.

                                                                  – cpburnz
                                                                  Aug 25 '14 at 14:10





                                                                  The OP specifically mentioned he did not want to completely disable the middle click button.

                                                                  – cpburnz
                                                                  Aug 25 '14 at 14:10













                                                                  I modified your one-liner to support multiple mice: xinput list | grep 'Mouse' | grep -o 'id=[0-9]*' | grep -o '[0-9]*' | xargs -i xinput set-button-map "" 1 0 3

                                                                  – Kurt
                                                                  Oct 23 '18 at 21:04





                                                                  I modified your one-liner to support multiple mice: xinput list | grep 'Mouse' | grep -o 'id=[0-9]*' | grep -o '[0-9]*' | xargs -i xinput set-button-map "" 1 0 3

                                                                  – Kurt
                                                                  Oct 23 '18 at 21:04











                                                                  0














                                                                  You might want to try emulating a two button mouse. With a two button mouse you paste by clicking both mouse buttons at the same time (rather then the scroll wheel).



                                                                  Install gpointing-device-settings:



                                                                  sudo aptitude install gpointing-device-settings


                                                                  http://live.gnome.org/GPointingDeviceSettings



                                                                  Alternately, if you do not wish to install gpointing-device-settings , and you are not bothered by command line options, see https://wiki.ubuntu.com/X/Config/Input On this wiki page there are several command line / configuration options, choose the one you prefer.






                                                                  share|improve this answer

























                                                                  • Will this still allow me to scroll in apps (such as Chrome) with the wheel though?? I'll give it a try, thanks!

                                                                    – neildeadman
                                                                    Jan 13 '12 at 8:12











                                                                  • App installs, but cannot see how it could help. Link to docs is broken.

                                                                    – HDave
                                                                    Feb 7 '14 at 19:48















                                                                  0














                                                                  You might want to try emulating a two button mouse. With a two button mouse you paste by clicking both mouse buttons at the same time (rather then the scroll wheel).



                                                                  Install gpointing-device-settings:



                                                                  sudo aptitude install gpointing-device-settings


                                                                  http://live.gnome.org/GPointingDeviceSettings



                                                                  Alternately, if you do not wish to install gpointing-device-settings , and you are not bothered by command line options, see https://wiki.ubuntu.com/X/Config/Input On this wiki page there are several command line / configuration options, choose the one you prefer.






                                                                  share|improve this answer

























                                                                  • Will this still allow me to scroll in apps (such as Chrome) with the wheel though?? I'll give it a try, thanks!

                                                                    – neildeadman
                                                                    Jan 13 '12 at 8:12











                                                                  • App installs, but cannot see how it could help. Link to docs is broken.

                                                                    – HDave
                                                                    Feb 7 '14 at 19:48













                                                                  0












                                                                  0








                                                                  0







                                                                  You might want to try emulating a two button mouse. With a two button mouse you paste by clicking both mouse buttons at the same time (rather then the scroll wheel).



                                                                  Install gpointing-device-settings:



                                                                  sudo aptitude install gpointing-device-settings


                                                                  http://live.gnome.org/GPointingDeviceSettings



                                                                  Alternately, if you do not wish to install gpointing-device-settings , and you are not bothered by command line options, see https://wiki.ubuntu.com/X/Config/Input On this wiki page there are several command line / configuration options, choose the one you prefer.






                                                                  share|improve this answer















                                                                  You might want to try emulating a two button mouse. With a two button mouse you paste by clicking both mouse buttons at the same time (rather then the scroll wheel).



                                                                  Install gpointing-device-settings:



                                                                  sudo aptitude install gpointing-device-settings


                                                                  http://live.gnome.org/GPointingDeviceSettings



                                                                  Alternately, if you do not wish to install gpointing-device-settings , and you are not bothered by command line options, see https://wiki.ubuntu.com/X/Config/Input On this wiki page there are several command line / configuration options, choose the one you prefer.







                                                                  share|improve this answer














                                                                  share|improve this answer



                                                                  share|improve this answer








                                                                  edited Jan 5 '14 at 14:53

























                                                                  answered Jan 12 '12 at 18:47









                                                                  PantherPanther

                                                                  79.8k14159259




                                                                  79.8k14159259












                                                                  • Will this still allow me to scroll in apps (such as Chrome) with the wheel though?? I'll give it a try, thanks!

                                                                    – neildeadman
                                                                    Jan 13 '12 at 8:12











                                                                  • App installs, but cannot see how it could help. Link to docs is broken.

                                                                    – HDave
                                                                    Feb 7 '14 at 19:48

















                                                                  • Will this still allow me to scroll in apps (such as Chrome) with the wheel though?? I'll give it a try, thanks!

                                                                    – neildeadman
                                                                    Jan 13 '12 at 8:12











                                                                  • App installs, but cannot see how it could help. Link to docs is broken.

                                                                    – HDave
                                                                    Feb 7 '14 at 19:48
















                                                                  Will this still allow me to scroll in apps (such as Chrome) with the wheel though?? I'll give it a try, thanks!

                                                                  – neildeadman
                                                                  Jan 13 '12 at 8:12





                                                                  Will this still allow me to scroll in apps (such as Chrome) with the wheel though?? I'll give it a try, thanks!

                                                                  – neildeadman
                                                                  Jan 13 '12 at 8:12













                                                                  App installs, but cannot see how it could help. Link to docs is broken.

                                                                  – HDave
                                                                  Feb 7 '14 at 19:48





                                                                  App installs, but cannot see how it could help. Link to docs is broken.

                                                                  – HDave
                                                                  Feb 7 '14 at 19:48











                                                                  0














                                                                  For Gnome applications you can use gnome-tweaks (new name of gnome-tweak-tool package) under the "Keyboard & Mouse" tab there's the "Middle Click Paste" option or editing directly the org.gnome.desktop.interface/gtk-enable-primary-paste Gnome option.



                                                                  For KDE applications seems that there's an equivalent solution.



                                                                  For the whole X (including non Gnome applications) you can install XMousePasteBlock which then has to be running (by the user is enough, no root required) in order to work. This disables completely the middle click paste without disabling the other middle click functions.






                                                                  share|improve this answer



























                                                                    0














                                                                    For Gnome applications you can use gnome-tweaks (new name of gnome-tweak-tool package) under the "Keyboard & Mouse" tab there's the "Middle Click Paste" option or editing directly the org.gnome.desktop.interface/gtk-enable-primary-paste Gnome option.



                                                                    For KDE applications seems that there's an equivalent solution.



                                                                    For the whole X (including non Gnome applications) you can install XMousePasteBlock which then has to be running (by the user is enough, no root required) in order to work. This disables completely the middle click paste without disabling the other middle click functions.






                                                                    share|improve this answer

























                                                                      0












                                                                      0








                                                                      0







                                                                      For Gnome applications you can use gnome-tweaks (new name of gnome-tweak-tool package) under the "Keyboard & Mouse" tab there's the "Middle Click Paste" option or editing directly the org.gnome.desktop.interface/gtk-enable-primary-paste Gnome option.



                                                                      For KDE applications seems that there's an equivalent solution.



                                                                      For the whole X (including non Gnome applications) you can install XMousePasteBlock which then has to be running (by the user is enough, no root required) in order to work. This disables completely the middle click paste without disabling the other middle click functions.






                                                                      share|improve this answer













                                                                      For Gnome applications you can use gnome-tweaks (new name of gnome-tweak-tool package) under the "Keyboard & Mouse" tab there's the "Middle Click Paste" option or editing directly the org.gnome.desktop.interface/gtk-enable-primary-paste Gnome option.



                                                                      For KDE applications seems that there's an equivalent solution.



                                                                      For the whole X (including non Gnome applications) you can install XMousePasteBlock which then has to be running (by the user is enough, no root required) in order to work. This disables completely the middle click paste without disabling the other middle click functions.







                                                                      share|improve this answer












                                                                      share|improve this answer



                                                                      share|improve this answer










                                                                      answered Feb 1 at 10:31









                                                                      Ilario GelmettiIlario Gelmetti

                                                                      162




                                                                      162





















                                                                          -1














                                                                          That's a good question, which i don't have an answer for (yet).
                                                                          A quick and dirty workaround is to remap it NOT to 0, but to 1.
                                                                          This way, it turns middle-"click" to left click, and does not affect your scroller...
                                                                          It is so far the best I can think of.



                                                                          Note:This information came from Ubuntu Forums, not my own noggin! :)






                                                                          share|improve this answer



























                                                                            -1














                                                                            That's a good question, which i don't have an answer for (yet).
                                                                            A quick and dirty workaround is to remap it NOT to 0, but to 1.
                                                                            This way, it turns middle-"click" to left click, and does not affect your scroller...
                                                                            It is so far the best I can think of.



                                                                            Note:This information came from Ubuntu Forums, not my own noggin! :)






                                                                            share|improve this answer

























                                                                              -1












                                                                              -1








                                                                              -1







                                                                              That's a good question, which i don't have an answer for (yet).
                                                                              A quick and dirty workaround is to remap it NOT to 0, but to 1.
                                                                              This way, it turns middle-"click" to left click, and does not affect your scroller...
                                                                              It is so far the best I can think of.



                                                                              Note:This information came from Ubuntu Forums, not my own noggin! :)






                                                                              share|improve this answer













                                                                              That's a good question, which i don't have an answer for (yet).
                                                                              A quick and dirty workaround is to remap it NOT to 0, but to 1.
                                                                              This way, it turns middle-"click" to left click, and does not affect your scroller...
                                                                              It is so far the best I can think of.



                                                                              Note:This information came from Ubuntu Forums, not my own noggin! :)







                                                                              share|improve this answer












                                                                              share|improve this answer



                                                                              share|improve this answer










                                                                              answered Sep 23 '10 at 17:49









                                                                              TiedeTiede

                                                                              693




                                                                              693





















                                                                                  -3














                                                                                  did you check out gpm ? More info at http://manpages.ubuntu.com/manpages/lucid/man8/gpm.8.html. Available via sudo aptitude install gpm on lucid. I don't see the disable-paste program in the ubuntu package however, the -A option may be worth giving a try.






                                                                                  share|improve this answer


















                                                                                  • 5





                                                                                    I don't understand gpm.. in the package description they state: "This package tries to be a useful mouse server for applications running on the Linux console." What does this have to do with applications running in windowed mode?

                                                                                    – levesque
                                                                                    Sep 21 '10 at 16:35
















                                                                                  -3














                                                                                  did you check out gpm ? More info at http://manpages.ubuntu.com/manpages/lucid/man8/gpm.8.html. Available via sudo aptitude install gpm on lucid. I don't see the disable-paste program in the ubuntu package however, the -A option may be worth giving a try.






                                                                                  share|improve this answer


















                                                                                  • 5





                                                                                    I don't understand gpm.. in the package description they state: "This package tries to be a useful mouse server for applications running on the Linux console." What does this have to do with applications running in windowed mode?

                                                                                    – levesque
                                                                                    Sep 21 '10 at 16:35














                                                                                  -3












                                                                                  -3








                                                                                  -3







                                                                                  did you check out gpm ? More info at http://manpages.ubuntu.com/manpages/lucid/man8/gpm.8.html. Available via sudo aptitude install gpm on lucid. I don't see the disable-paste program in the ubuntu package however, the -A option may be worth giving a try.






                                                                                  share|improve this answer













                                                                                  did you check out gpm ? More info at http://manpages.ubuntu.com/manpages/lucid/man8/gpm.8.html. Available via sudo aptitude install gpm on lucid. I don't see the disable-paste program in the ubuntu package however, the -A option may be worth giving a try.







                                                                                  share|improve this answer












                                                                                  share|improve this answer



                                                                                  share|improve this answer










                                                                                  answered Sep 21 '10 at 16:27









                                                                                  koushikkoushik

                                                                                  3,64632032




                                                                                  3,64632032







                                                                                  • 5





                                                                                    I don't understand gpm.. in the package description they state: "This package tries to be a useful mouse server for applications running on the Linux console." What does this have to do with applications running in windowed mode?

                                                                                    – levesque
                                                                                    Sep 21 '10 at 16:35













                                                                                  • 5





                                                                                    I don't understand gpm.. in the package description they state: "This package tries to be a useful mouse server for applications running on the Linux console." What does this have to do with applications running in windowed mode?

                                                                                    – levesque
                                                                                    Sep 21 '10 at 16:35








                                                                                  5




                                                                                  5





                                                                                  I don't understand gpm.. in the package description they state: "This package tries to be a useful mouse server for applications running on the Linux console." What does this have to do with applications running in windowed mode?

                                                                                  – levesque
                                                                                  Sep 21 '10 at 16:35






                                                                                  I don't understand gpm.. in the package description they state: "This package tries to be a useful mouse server for applications running on the Linux console." What does this have to do with applications running in windowed mode?

                                                                                  – levesque
                                                                                  Sep 21 '10 at 16:35






                                                                                  protected by Community Dec 15 '18 at 16:16



                                                                                  Thank you for your interest in this question.
                                                                                  Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).



                                                                                  Would you like to answer one of these unanswered questions instead?



                                                                                  Popular posts from this blog

                                                                                  Möglingen Índice Localización Historia Demografía Referencias Enlaces externos Menú de navegación48°53′18″N 9°07′45″E / 48.888333333333, 9.129166666666748°53′18″N 9°07′45″E / 48.888333333333, 9.1291666666667Sitio web oficial Mapa de Möglingen«Gemeinden in Deutschland nach Fläche, Bevölkerung und Postleitzahl am 30.09.2016»Möglingen

                                                                                  Virtualbox - Configuration error: Querying “UUID” failed (VERR_CFGM_VALUE_NOT_FOUND)“VERR_SUPLIB_WORLD_WRITABLE” error when trying to installing OS in virtualboxVirtual Box Kernel errorFailed to open a seesion for the virtual machineFailed to open a session for the virtual machineUbuntu 14.04 LTS Virtualbox errorcan't use VM VirtualBoxusing virtualboxI can't run Linux-64 Bit on VirtualBoxUnable to insert the virtual optical disk (VBoxguestaddition) in virtual machine for ubuntu server in win 10VirtuaBox in Ubuntu 18.04 Issues with Win10.ISO Installation

                                                                                  Antonio De Lisio Carrera Referencias Menú de navegación«Caracas: evolución relacional multipleja»«Cuando los gobiernos subestiman a las localidades: L a Iniciativa para la Integración de la Infraestructura Regional Suramericana (IIRSA) en la frontera Colombo-Venezolana»«Maestría en Planificación Integral del Ambiente»«La Metrópoli Caraqueña: Expansión Simplificadora o Articulación Diversificante»«La Metrópoli Caraqueña: Expansión Simplificadora o Articulación Diversificante»«Conózcanos»«Caracas: evolución relacional multipleja»«La Metrópoli Caraqueña: Expansión Simplificadora o Articulación Diversificante»