How to configure a Trackpoint, so middle-click scrolling is not misinterpreted as a middle-click paste

clipboardmousescrollingthinkpad

I'm using a Thinkpad USB Trackpoint keyboard, and when I try to scroll, using middle-click and the trackpoint, sometimes it performs a middle-click paste. I don't recall this ever happening with the built in keyboard on my laptop.

Is there a way to configure the middle "mouse" button, so it doesn't misinterpret middle click scrolling as a middle click paste?

Note:
I don't want to disable the middle mouse button. I want to be able to scroll.

Best Answer

Here is the Ubuntu Wiki entry on how to disable the middle mouse button. This should work on any system using X.

Example: Disabling middle-mouse button paste on a scrollwheel mouse

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='

"Virtual core pointer"  id=0    [XPointer]
"Virtual core keyboard" id=1    [XKeyboard]
"AT Translated Set 2 keyboard"  id=2    [XExtensionKeyboard]
"Macintosh mouse button emulation"      id=3    [XExtensionPointer]
"Logitech USB-PS/2 Optical Mouse"       id=4    [XExtensionPointer]

My mouse has the Logitech logo printed on it, so I gather I need the last entry.

I can view the current button mapping thusly:

$ xinput get-button-map 4

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 10

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

$ xinput get-button-map 4

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

$ xinput set-button-map 4 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 4 1 1 3

To make this set on a per-user basis, I can plug that line into my ~/.xstartup or other init file. It can also be done via configuring a matching InputClass section on xorg.conf.

The above example does not disable scrolling; if you want to do that see here.

Related Question