Page 3 of 3 FirstFirst 123
Results 21 to 25 of 25

Thread: How to get rid of middle-click paste (Without disabling or remapping the middle btn)

  1. #21
    Join Date
    Apr 2010
    Beans
    5
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: How to get rid of middle-click paste (Without disabling or remapping the middle b

    I doubt it is possible to disable it through Ubuntu. It is part of the X11 specifications and is a feature. Unless you run a custom version of X11, you're out of luck.
    With all of the clipboard bugs in 11.04 (especially with Eclipse and Code::Blocks), the X11 selection buffer is sadly the only thing I can rely on.

    Unless someone makes a patched version of X with the selection buffer disabled, which is most likely not happening anytime soon, you better learn to live with it.

  2. #22
    Join Date
    Oct 2011
    Beans
    1

    Re: How to get rid of middle-click paste (Without disabling or remapping the middle b

    One workaround could be to clear the selection clipboard manually using a program like xclip. Then even though middle click still pastes the selection, nothing happens because the selection is empty. That is:
    Code:
    #!/bin/bash
    while true; do
    	xclip -i /dev/null
    	sleep 10
    done
    This clears the selection once in 10 seconds.

    The downside is that many X programs seem function so that once the selection is cleared, then also the highlighted text is cleared in the program.
    For example: In Lyx, when one highlights a part of a text, this is copied by the X server. When the script above clears the selection, then the highlighted text in Lyx is no longer highlighted.

  3. #23
    Join Date
    Feb 2010
    Beans
    9

    Re: How to get rid of middle-click paste (Without disabling or remapping the middle b

    Another way: for me, the annoying thing was that it pastes in Firefox (while using gmail, in forms, etc). So I disabled the middle-click paste behaviour just in Firefox, and it works very good:
    http://www.thinkwiki.org/wiki/How_to...refox_3_tweaks

  4. #24
    Join Date
    Apr 2009
    Location
    USA
    Beans
    110
    Distro
    Ubuntu 10.04 Lucid Lynx

    Thumbs down Re: How to get rid of middle-click paste (Without disabling or remapping the middle b

    I absolutely concur, this is highly annoying!!!

    Many mice, old or brand new, have light springs under the scroll-wheel that click the middle button far too easily.

    I have a Microsoft intelligent trackball device that I'd rather not discontinue using. Maybe I can try to expand the coils of the spring or find replacement parts online.

    Either way, we should still be able to disable the feature via a menu:
    i.e. in 8.04 -> Menu -> Settings -> Peripherals -> Mouse ...

  5. #25
    Join Date
    Apr 2011
    Beans
    Hidden!

    Re: How to get rid of middle-click paste (Without disabling or remapping the middle b

    I like the middle-click paste in some apps and hate it in others, especially using a touchpad.
    Apparently it's only X.Org that can change the setup of the X11 Primary Selection (Clipboard) in order to make a deactivation possible.
    Or OS distributions do not provide the possibility to change the settings.
    http://www.jwz.org/doc/x-cut-and-paste.html
    Up to now I could not find any suitable workaround and deactivating the button (or the scrolling) in general was not an option for me.

    Now I found this amazing app called 'Easystroke Gesture Recognition' which comes with the Ubuntu Repository. http://sourceforge.net/projects/easystroke/
    Easystroke is a gesture-recognition application for X11. Gestures or strokes are movements that you make with you mouse (or your pen, finger etc.) while holding down a specific mouse button. Easystroke will execute certain actions if it recognizes the stroke; currently easystroke can emulate key presses, execute shell commands, hold down modifiers and emulate a scroll wheel. The program was designed with Tablet PCs in mind and can be used effectively even without access to a keyboard. Easystroke tries to provide an intuitive and efficient user interface, while at the same time being highly configurable and offering many advanced features.
    It's set up in a minute, really easy to use and accurate.
    You can use it to deactivate the middle-click in certain apps or by 'Default' and add exceptions,
    or you can replace the copied text (Primary Selection) by a blank, so that middle-click paste creates no output. In both cases scrolling still works.
    Code:
    sudo apt-get install easystroke
    I just deactivate/blank the middle-click paste by 'Default' and add some apps like Terminal, Desktop, Browser, Editor as exceptions:

    When you run the app it will open the first tab 'Actions'.
    Click 'Add Action' (bottom)
    Enter a name for the new action eg 'Gesture 1'
    Choose the Type 'Ignore' to deactivate or choose 'Text' to paste a blank, leave Details empty
    Click 'Record Stroke' and click the mouse middle button
    Click 'Yes' on the safety advise
    Click on the next tab 'Preferences'
    Click 'Add Exception' and your cursor will turn into small cross hairs
    Click the app you want to be excepted from the deactivation/blank paste, repeat for others
    On the same tab uncheck 'Show popups' and check 'Autostart easystroke'
    Done

    It works great for me and hopefully for you too.

    Cheers
    Last edited by Marric; April 2nd, 2012 at 06:11 AM.

Page 3 of 3 FirstFirst 123

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •