10

I want to disable middle mouse button paste, but still be able to:

  • Close tabs by clicking it with the scrollwheel
  • Open links in a new tab by clicking the link with the scrollwheel.

I tried this, but that makes closing tabs and clicking links unusable.

This question is not a duplicate because in the other question they want to disable the middle mouse button completely.

MatMis
  • 523
  • @Sparhawk I don't think this question is a duplicate of question you linked because they want to disable the middle mouse button completely and that is not what I want. I only want to disable the paste functionality. – MatMis Dec 14 '18 at 14:41
  • I agree it's not explicit in the other, but half of the answers interpret it as that. Have you tried any of them? Also note that the linked question has two other questions marked as dupes, which you can see in the "Linked" section to the right of that question. The first, especially has even more solutions. Have you tried those? – Sparhawk Dec 14 '18 at 23:26

1 Answers1

5

Scrollwheel mice support a middle-button click event when pressing the scrollwheel. This is a great feature, but you may find it irritating. Fortunately it can be disabled.

First, you need to know the id of the mouse, like this:

$ xinput list | grep 'id='

which prints something like

⎡ Virtual core pointer                      id=2    [master pointer  (3)]
⎜ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜ PixArt Dell MS116 USB Optical Mouse       id=12   [slave  pointer  (2)]
⎣ Virtual core keyboard                     id=3    [master keyboard (2)]
  Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
  Power Button                              id=6    [slave  keyboard (3)]
  Video Bus                                 id=7    [slave  keyboard (3)]
  Power Button                              id=8    [slave  keyboard (3)]
  Sleep Button                              id=9    [slave  keyboard (3)]
  Dell KB216 Wired Keyboard                 id=10   [slave  keyboard (3)]
  Dell KB216 Wired Keyboard                 id=11   [slave  keyboard (3)]
  Eee PC WMI hotkeys                        id=13   [slave  keyboard (3)]

My Dell Usb mouse has printed here for which id=12

so, I can view the my mouse button mapping like:

$ xinput get-button-map 12

which prints

1 2 3 4 5 6 7 8 9 10 11 12

here only the first three numbers have meaning for me. They represent the left, middle, and right mouse buttons.

I can turn the middle mouse button off by setting it to 0:

$ xinput set-button-map 12 1 0 3

Or I can turn the middle-mouse button into a left-mouse button by setting it to 1:

$ xinput set-button-map 12 1 1 3

ref. link https://wiki.ubuntu.com/X/Config/Input

it works for me ( kubuntu 18.04 LTS )

  • 4
    It say's "turn the middle mouse button off by setting it to 0". That is also exactly what is does, but I want to be able to close tabs. When I follow that guide, the middle mouse click is turned off and I can't close tabs anymore by clicking it with the scrollwheel. That is not what I want. I think the title of that example is misleading and it should be: "Turn off the middle mouse click" instead of "Disabling middle-mouse button paste on a scrollwheel mouse" – MatMis Dec 14 '18 at 14:25
  • 1
    @kemotep ohh.. sorry but this is my first answer. so i just typed what i did in short. will update it. – Suraj Inamdar Dec 17 '18 at 06:16
  • @MatMis yes. it disables middle mouse button and thats your question title is subjected to. – Suraj Inamdar Dec 17 '18 at 06:19
  • 1
    @SurajInamdar No, the title says "disable middle mouse button paste" not the entire button. – MatMis Dec 17 '18 at 19:37
  • @MatMis: True, but I wanted the whole button disabled, so this is exactly what I wanted :) – Quandary Oct 20 '19 at 22:17