Any updates on disabling middle-click paste?
I'm using the middle mouse button on my ThinkPad with Ubuntu to scroll and I'm pasting a lot of text in my documents by accident which is very annoying and I often end up with messed up documents.
I searched on the internet how to disable this feature. The only quick solution I've found is to execute xmodmap -e "pointer = 1 25 3 4 5 6 7 8 9"
in the konsole or for a persistent change to put pointer = 1 25 3 4 5 6 7 8 9
in the ~/.Xmodmap
file. So the middle butten gets remapped to another button. This works fine for me, but now I cannot use use the middle mouse button for anything else---especially not for my beloved feature of opening new tabs in firefox by middle-clicking. Or just anything else...
Apart from directly patching the GTK I was not able to find anything else. Does someone know a more elegant way to disbale the middle-click-paste functionality in Ubuntu?
my system:
ThinkPad-R61
3.8.0-30-generic #44-Ubuntu SMP Thu Aug 22 20:54:42 UTC 2013 i686 i686 i686 GNU/Linux
mouse thinkpad scrolling
add a comment |
I'm using the middle mouse button on my ThinkPad with Ubuntu to scroll and I'm pasting a lot of text in my documents by accident which is very annoying and I often end up with messed up documents.
I searched on the internet how to disable this feature. The only quick solution I've found is to execute xmodmap -e "pointer = 1 25 3 4 5 6 7 8 9"
in the konsole or for a persistent change to put pointer = 1 25 3 4 5 6 7 8 9
in the ~/.Xmodmap
file. So the middle butten gets remapped to another button. This works fine for me, but now I cannot use use the middle mouse button for anything else---especially not for my beloved feature of opening new tabs in firefox by middle-clicking. Or just anything else...
Apart from directly patching the GTK I was not able to find anything else. Does someone know a more elegant way to disbale the middle-click-paste functionality in Ubuntu?
my system:
ThinkPad-R61
3.8.0-30-generic #44-Ubuntu SMP Thu Aug 22 20:54:42 UTC 2013 i686 i686 i686 GNU/Linux
mouse thinkpad scrolling
add a comment |
I'm using the middle mouse button on my ThinkPad with Ubuntu to scroll and I'm pasting a lot of text in my documents by accident which is very annoying and I often end up with messed up documents.
I searched on the internet how to disable this feature. The only quick solution I've found is to execute xmodmap -e "pointer = 1 25 3 4 5 6 7 8 9"
in the konsole or for a persistent change to put pointer = 1 25 3 4 5 6 7 8 9
in the ~/.Xmodmap
file. So the middle butten gets remapped to another button. This works fine for me, but now I cannot use use the middle mouse button for anything else---especially not for my beloved feature of opening new tabs in firefox by middle-clicking. Or just anything else...
Apart from directly patching the GTK I was not able to find anything else. Does someone know a more elegant way to disbale the middle-click-paste functionality in Ubuntu?
my system:
ThinkPad-R61
3.8.0-30-generic #44-Ubuntu SMP Thu Aug 22 20:54:42 UTC 2013 i686 i686 i686 GNU/Linux
mouse thinkpad scrolling
I'm using the middle mouse button on my ThinkPad with Ubuntu to scroll and I'm pasting a lot of text in my documents by accident which is very annoying and I often end up with messed up documents.
I searched on the internet how to disable this feature. The only quick solution I've found is to execute xmodmap -e "pointer = 1 25 3 4 5 6 7 8 9"
in the konsole or for a persistent change to put pointer = 1 25 3 4 5 6 7 8 9
in the ~/.Xmodmap
file. So the middle butten gets remapped to another button. This works fine for me, but now I cannot use use the middle mouse button for anything else---especially not for my beloved feature of opening new tabs in firefox by middle-clicking. Or just anything else...
Apart from directly patching the GTK I was not able to find anything else. Does someone know a more elegant way to disbale the middle-click-paste functionality in Ubuntu?
my system:
ThinkPad-R61
3.8.0-30-generic #44-Ubuntu SMP Thu Aug 22 20:54:42 UTC 2013 i686 i686 i686 GNU/Linux
mouse thinkpad scrolling
mouse thinkpad scrolling
edited Sep 24 '13 at 16:20
Stan
asked Sep 24 '13 at 14:17
StanStan
7961613
7961613
add a comment |
add a comment |
4 Answers
4
active
oldest
votes
There is some clean solution that works on Ubuntu 14.04. I obtained it by running gnome-tweak-tool -v -d
. The solution is:
gsettings set org.gnome.settings-daemon.plugins.xsettings overrides "{'Gtk/EnablePrimaryPaste': <0>}"
It can be done in dconf-editor as well: org->gnome->settings-daemon->plugins->xsettings --->>> overrides and put {'Gtk/EnablePrimaryPaste': <0>}
.
To activate it you can put 1 instead of 0.
Just tried this and failed. Am I correct that this does not work anymore on Ubuntu 18. (If it ever did, more likely it was equivalent to switching of the middle mouse button in Gnome Tweak Tool which does not actually work accept in a select few programs.)
– Kvothe
Aug 30 '18 at 14:40
add a comment |
What I ended up doing was creating two aliaseses in .bashrc
:
alias mc-off='xmodmap -e "pointer = 1 25 3 4 5 6 7 8 9"'
alias mc-on='xmodmap -e "pointer = 1 2 3 4 5 6 7 8 9"'
Now every time I need to disable the trackpad's middle click I run mc-off
from a terminal and mc-on
to switch it back on when I plug a mouse.
1
+1 for simplicity/effectiveness ratio!
– ThingumaBob
Sep 2 '18 at 20:44
add a comment |
Here's the best 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 + shift + 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.)
This worked for me on Ubuntu 18.04 on a Thinkpad Carbon X1.
– Joel
Feb 14 at 1:11
add a comment |
I too tried to look for a clean solution to this problem, but ended up going for a surprisingly effective work-around. If you have xsel
installed, you can clear the contents of the primary paste buffer (the one used by the middle mouse) with xsel -p -c
. You can then create a keyboard shortcut that executes this command, and map it to any unused keys (in my case, the rectangular ThinkPad button which is farthest to the right in the left-hand corner of the space above the keyboard proper on my ThinkPad X230; you should have a similar button (might be blue on your model), but if not, you can use any other vestigial button that you wish). I used the system preferences pane for Keyboard Shortcuts to do this, so Xmodmap is not required for this workaround. Now, whenever I want to use my middle mouse, I press this button to clear any content that might be in the paste-buffer, and it works perfectly, without the need to cripple the functionality of the middle mouse.
I hope you find this response useful, or otherwise find the answer you are looking for.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f349503%2fany-updates-on-disabling-middle-click-paste%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
There is some clean solution that works on Ubuntu 14.04. I obtained it by running gnome-tweak-tool -v -d
. The solution is:
gsettings set org.gnome.settings-daemon.plugins.xsettings overrides "{'Gtk/EnablePrimaryPaste': <0>}"
It can be done in dconf-editor as well: org->gnome->settings-daemon->plugins->xsettings --->>> overrides and put {'Gtk/EnablePrimaryPaste': <0>}
.
To activate it you can put 1 instead of 0.
Just tried this and failed. Am I correct that this does not work anymore on Ubuntu 18. (If it ever did, more likely it was equivalent to switching of the middle mouse button in Gnome Tweak Tool which does not actually work accept in a select few programs.)
– Kvothe
Aug 30 '18 at 14:40
add a comment |
There is some clean solution that works on Ubuntu 14.04. I obtained it by running gnome-tweak-tool -v -d
. The solution is:
gsettings set org.gnome.settings-daemon.plugins.xsettings overrides "{'Gtk/EnablePrimaryPaste': <0>}"
It can be done in dconf-editor as well: org->gnome->settings-daemon->plugins->xsettings --->>> overrides and put {'Gtk/EnablePrimaryPaste': <0>}
.
To activate it you can put 1 instead of 0.
Just tried this and failed. Am I correct that this does not work anymore on Ubuntu 18. (If it ever did, more likely it was equivalent to switching of the middle mouse button in Gnome Tweak Tool which does not actually work accept in a select few programs.)
– Kvothe
Aug 30 '18 at 14:40
add a comment |
There is some clean solution that works on Ubuntu 14.04. I obtained it by running gnome-tweak-tool -v -d
. The solution is:
gsettings set org.gnome.settings-daemon.plugins.xsettings overrides "{'Gtk/EnablePrimaryPaste': <0>}"
It can be done in dconf-editor as well: org->gnome->settings-daemon->plugins->xsettings --->>> overrides and put {'Gtk/EnablePrimaryPaste': <0>}
.
To activate it you can put 1 instead of 0.
There is some clean solution that works on Ubuntu 14.04. I obtained it by running gnome-tweak-tool -v -d
. The solution is:
gsettings set org.gnome.settings-daemon.plugins.xsettings overrides "{'Gtk/EnablePrimaryPaste': <0>}"
It can be done in dconf-editor as well: org->gnome->settings-daemon->plugins->xsettings --->>> overrides and put {'Gtk/EnablePrimaryPaste': <0>}
.
To activate it you can put 1 instead of 0.
edited Jul 5 '15 at 12:33
muru
1
1
answered Jul 5 '15 at 12:31
cyberalex4lifecyberalex4life
595
595
Just tried this and failed. Am I correct that this does not work anymore on Ubuntu 18. (If it ever did, more likely it was equivalent to switching of the middle mouse button in Gnome Tweak Tool which does not actually work accept in a select few programs.)
– Kvothe
Aug 30 '18 at 14:40
add a comment |
Just tried this and failed. Am I correct that this does not work anymore on Ubuntu 18. (If it ever did, more likely it was equivalent to switching of the middle mouse button in Gnome Tweak Tool which does not actually work accept in a select few programs.)
– Kvothe
Aug 30 '18 at 14:40
Just tried this and failed. Am I correct that this does not work anymore on Ubuntu 18. (If it ever did, more likely it was equivalent to switching of the middle mouse button in Gnome Tweak Tool which does not actually work accept in a select few programs.)
– Kvothe
Aug 30 '18 at 14:40
Just tried this and failed. Am I correct that this does not work anymore on Ubuntu 18. (If it ever did, more likely it was equivalent to switching of the middle mouse button in Gnome Tweak Tool which does not actually work accept in a select few programs.)
– Kvothe
Aug 30 '18 at 14:40
add a comment |
What I ended up doing was creating two aliaseses in .bashrc
:
alias mc-off='xmodmap -e "pointer = 1 25 3 4 5 6 7 8 9"'
alias mc-on='xmodmap -e "pointer = 1 2 3 4 5 6 7 8 9"'
Now every time I need to disable the trackpad's middle click I run mc-off
from a terminal and mc-on
to switch it back on when I plug a mouse.
1
+1 for simplicity/effectiveness ratio!
– ThingumaBob
Sep 2 '18 at 20:44
add a comment |
What I ended up doing was creating two aliaseses in .bashrc
:
alias mc-off='xmodmap -e "pointer = 1 25 3 4 5 6 7 8 9"'
alias mc-on='xmodmap -e "pointer = 1 2 3 4 5 6 7 8 9"'
Now every time I need to disable the trackpad's middle click I run mc-off
from a terminal and mc-on
to switch it back on when I plug a mouse.
1
+1 for simplicity/effectiveness ratio!
– ThingumaBob
Sep 2 '18 at 20:44
add a comment |
What I ended up doing was creating two aliaseses in .bashrc
:
alias mc-off='xmodmap -e "pointer = 1 25 3 4 5 6 7 8 9"'
alias mc-on='xmodmap -e "pointer = 1 2 3 4 5 6 7 8 9"'
Now every time I need to disable the trackpad's middle click I run mc-off
from a terminal and mc-on
to switch it back on when I plug a mouse.
What I ended up doing was creating two aliaseses in .bashrc
:
alias mc-off='xmodmap -e "pointer = 1 25 3 4 5 6 7 8 9"'
alias mc-on='xmodmap -e "pointer = 1 2 3 4 5 6 7 8 9"'
Now every time I need to disable the trackpad's middle click I run mc-off
from a terminal and mc-on
to switch it back on when I plug a mouse.
answered Jan 23 '18 at 10:04
h3nr1xh3nr1x
1113
1113
1
+1 for simplicity/effectiveness ratio!
– ThingumaBob
Sep 2 '18 at 20:44
add a comment |
1
+1 for simplicity/effectiveness ratio!
– ThingumaBob
Sep 2 '18 at 20:44
1
1
+1 for simplicity/effectiveness ratio!
– ThingumaBob
Sep 2 '18 at 20:44
+1 for simplicity/effectiveness ratio!
– ThingumaBob
Sep 2 '18 at 20:44
add a comment |
Here's the best 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 + shift + 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.)
This worked for me on Ubuntu 18.04 on a Thinkpad Carbon X1.
– Joel
Feb 14 at 1:11
add a comment |
Here's the best 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 + shift + 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.)
This worked for me on Ubuntu 18.04 on a Thinkpad Carbon X1.
– Joel
Feb 14 at 1:11
add a comment |
Here's the best 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 + shift + 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.)
Here's the best 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 + shift + 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.)
edited 2 hours ago
answered Sep 30 '18 at 22:05
CestarianCestarian
1214
1214
This worked for me on Ubuntu 18.04 on a Thinkpad Carbon X1.
– Joel
Feb 14 at 1:11
add a comment |
This worked for me on Ubuntu 18.04 on a Thinkpad Carbon X1.
– Joel
Feb 14 at 1:11
This worked for me on Ubuntu 18.04 on a Thinkpad Carbon X1.
– Joel
Feb 14 at 1:11
This worked for me on Ubuntu 18.04 on a Thinkpad Carbon X1.
– Joel
Feb 14 at 1:11
add a comment |
I too tried to look for a clean solution to this problem, but ended up going for a surprisingly effective work-around. If you have xsel
installed, you can clear the contents of the primary paste buffer (the one used by the middle mouse) with xsel -p -c
. You can then create a keyboard shortcut that executes this command, and map it to any unused keys (in my case, the rectangular ThinkPad button which is farthest to the right in the left-hand corner of the space above the keyboard proper on my ThinkPad X230; you should have a similar button (might be blue on your model), but if not, you can use any other vestigial button that you wish). I used the system preferences pane for Keyboard Shortcuts to do this, so Xmodmap is not required for this workaround. Now, whenever I want to use my middle mouse, I press this button to clear any content that might be in the paste-buffer, and it works perfectly, without the need to cripple the functionality of the middle mouse.
I hope you find this response useful, or otherwise find the answer you are looking for.
add a comment |
I too tried to look for a clean solution to this problem, but ended up going for a surprisingly effective work-around. If you have xsel
installed, you can clear the contents of the primary paste buffer (the one used by the middle mouse) with xsel -p -c
. You can then create a keyboard shortcut that executes this command, and map it to any unused keys (in my case, the rectangular ThinkPad button which is farthest to the right in the left-hand corner of the space above the keyboard proper on my ThinkPad X230; you should have a similar button (might be blue on your model), but if not, you can use any other vestigial button that you wish). I used the system preferences pane for Keyboard Shortcuts to do this, so Xmodmap is not required for this workaround. Now, whenever I want to use my middle mouse, I press this button to clear any content that might be in the paste-buffer, and it works perfectly, without the need to cripple the functionality of the middle mouse.
I hope you find this response useful, or otherwise find the answer you are looking for.
add a comment |
I too tried to look for a clean solution to this problem, but ended up going for a surprisingly effective work-around. If you have xsel
installed, you can clear the contents of the primary paste buffer (the one used by the middle mouse) with xsel -p -c
. You can then create a keyboard shortcut that executes this command, and map it to any unused keys (in my case, the rectangular ThinkPad button which is farthest to the right in the left-hand corner of the space above the keyboard proper on my ThinkPad X230; you should have a similar button (might be blue on your model), but if not, you can use any other vestigial button that you wish). I used the system preferences pane for Keyboard Shortcuts to do this, so Xmodmap is not required for this workaround. Now, whenever I want to use my middle mouse, I press this button to clear any content that might be in the paste-buffer, and it works perfectly, without the need to cripple the functionality of the middle mouse.
I hope you find this response useful, or otherwise find the answer you are looking for.
I too tried to look for a clean solution to this problem, but ended up going for a surprisingly effective work-around. If you have xsel
installed, you can clear the contents of the primary paste buffer (the one used by the middle mouse) with xsel -p -c
. You can then create a keyboard shortcut that executes this command, and map it to any unused keys (in my case, the rectangular ThinkPad button which is farthest to the right in the left-hand corner of the space above the keyboard proper on my ThinkPad X230; you should have a similar button (might be blue on your model), but if not, you can use any other vestigial button that you wish). I used the system preferences pane for Keyboard Shortcuts to do this, so Xmodmap is not required for this workaround. Now, whenever I want to use my middle mouse, I press this button to clear any content that might be in the paste-buffer, and it works perfectly, without the need to cripple the functionality of the middle mouse.
I hope you find this response useful, or otherwise find the answer you are looking for.
answered Mar 3 '15 at 21:47
archaephyrryxarchaephyrryx
101
101
add a comment |
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f349503%2fany-updates-on-disabling-middle-click-paste%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown