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.

2 Answers 2


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.

  • I don't want to disable the middle mouse button. I want to be able to scroll.
    – jumpnett
    Mar 23, 2015 at 17:09
  • The middle mouse button is the button not the scrolling part. try it and see if it works. The scrolling function is registered differently if you looked at the example there was over 25 different input actions. try it.
    – West
    Mar 23, 2015 at 17:12
  • Must of missunderstood. I'll try it. :)
    – jumpnett
    Mar 23, 2015 at 17:18
  • Sweet, it worked.
    – jumpnett
    Mar 23, 2015 at 17:23
  • 1
    @PrunusPersica I don't have this issue with my current installation, so I haven't messed with this in a year or so. I don't recall ever resolving that issue though. Sorry I couldn't be of any help.
    – jumpnett
    Feb 1, 2021 at 19:29

With Ubuntu 17 and in XFCE the middle mouse button copy paste did not work at all. Same applies for Fedora 26 XFCE, same solution works for Fedora 26 Middle Mouse Button Paste (q.e.d.):


To enable the middle mouse button paste function edit the xinput.

  1. Query your device to identify your mouse (mine was listed as device 10):

    xinput list
  2. List mouse settings:

    xinput list-props <your_mouse_device_number>
  3. Change the value for "libinput Middle Emulation Enabled (294):" (as root):

    sudo xinput set-prop 10 "libinput Middle Emulation Enabled" 1
  4. Check if the value changed to 1:

    xinput list-props 10

The output should be libinput Middle Emulation Enabled (294): 1

Many, many thanks to Gilles (https://unix.stackexchange.com/users/885/gilles) who found the solution!

Read more: https://wiki.ubuntu.com/X/Config/Input

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.