» Disable middle mouse pasting (sort of)
Someone asked on IRC how to disable middle mouse pasting in X. Seems like it's a mystery to almost everyone as it's asked on quite a few forums but always left unanswered.
I wouldn't want to miss that feature, personally, but well, here's a trick to disable middle mouse pasting in X:
- list your current mouse pointer X mappings using
xmodmap -pp
(look at the 2nd column) - swap the button 2 with some unused one, typically the highest number
- add a line e.g. "pointer = 1 9 3 4 5 6 7 8 2" (if you have 9 buttons, for the sake of an example) to
~/.Xmodmap
xmodmap -pp |perl -ne 'BEGIN{@a=();$h=0}
{next unless /^\s*\d+\s+\d+\s*$/;
($v)=/^\s*\d+\s+(\d+)\s*$/; push(@a,$v);
if ($v gt $h) {$h=$v}}
END{@b=();foreach(@a){
if ($_ eq "2"){push(@b,$h)} elsif($_ eq $h){push(@b,"2")} else{push(@b,$_)}
}; print "pointer = ".join(" ",@b)."\n";}' >> ~/.Xmodmap
1 Comments:
Actually, I'm the guy that asked that. :D My Middle Mouse button has been acting up for a while. It has gotten very touchy in it's old age. When I would try to scroll with it, it would invariably click and paste the last contents in the browser address or wherever I was. That was getting very annoying. I had been looking for a solution to this for 3 weeks off and on.
I finally logged on to an IRC chat and Loki helped me though it!
I would just like to personally thank Loki for his assistance in this matter. The fix worked fantastically.
Your great.
Paul
Montana, USA
Post a Comment
<< Home