ThinkPad Middle Mouse Button Scroll – Ubuntu Linux

This solution applies to Ubuntu LInux Natty Narwhal 11.04, Maverick Meerkat 10.10, and Lucid Lynx 10.04.

Update (Oct. 17, 2010): Thanks to the comments below for an updated solution for Ubuntu Maverick Meerkat 10.10. If you are upgrading from 10.04, insert the following into Terminal:

sudo mv /usr/lib/X11/xorg.conf.d/20-thinkpad.conf /usr/share/X11/xorg.conf.d/20-thinkpad.conf

If this sounds like news to you, then follow the detailed instructions below, except change step one as follows:

Step 1. Create a new file

sudo nano
/usr/share/X11/xorg.conf.d/20-thinkpad.conf

***

It’s that special time of year again! I have just finished upgrading my trusty ThinkPad T61 to the latest version of Ubuntu Linux — 10.04 Lucid Lynx. This edition of the operating system no longer employs the udev method of emulating scrolling. With the following instructions, one will be able to scroll with the middle button both vertically and horizontally:

Step 1. Create a new file

sudo nano /usr/lib/X11/xorg.conf.d/20-thinkpad.conf

Step 2. Insert the following

Section "InputClass"
Identifier "Trackpoint Wheel Emulation"
MatchProduct "TPPS/2 IBM TrackPoint|DualPoint Stick|Synaptics Inc. Composite TouchPad / TrackPoint"
MatchDevicePath "/dev/input/event*"
Option "EmulateWheel" "true"
Option "EmulateWheelButton" "2"
Option "Emulate3Buttons" "false"
Option "XAxisMapping" "6 7"
Option "YAxisMapping" "4 5"
EndSection

Step 3. Save file, restart computer, and enjoy!

Please comment and let me know whether this solution worked for you, or if you have alternative methods.

By the way, I’m not able to get the fingerprint reader working. Has anyone had any luck with it? Any tips to share? *Update: Fingerprint GUI seems quite effective.

95 thoughts on “ThinkPad Middle Mouse Button Scroll – Ubuntu Linux

  1. Works for my T61.
    For some reason after upgrade from Karmic to Lucid middle button scroll worked and failed only with recent Lucid kernel update.
    Found a temp workaround: log out after restart then log in again.
    Thanks for the real solution.

  2. This doesn’t work for me. I can’t create the file 20-thinkpad.conf and so I can’t save the file in nano…. am I doing something wrong?

  3. I have a trackpoint on my usb keyboard, and it was not matched by the agove MatchProduct. I had to add “USB Trackpoint pointing device” to the list to make it work. See http://www.thinkwiki.org/wiki/How_to_configure_the_TrackPoint#xorg.conf.d for a many descriptions of how to configure trackpoint.

    I used

    echo /dev/input/event* | xargs -n1 | xargs -i udevadm info –attribute-walk –name={} | grep product | sort -u

    to find the possible names for my keyboard mouse.

  4. Working on a R40, thanx :)

    However there’s a small annoying delay between the time i click and when i start scrolling. It is just me or it’s happening with everyone?

  5. On my T400, its acting as a third mouse and doing some funky stuff when I click down on it.

    For some reason, its interpreting the trackpoint middle button as the paste command (as in copy and paste).

    Is there a way to disable this?

    Also, I’m using an Xubuntu session if that makes a difference.

    • In my case:

      Press down on middle button and then let go –> acts as paste
      Press down on middle button but don’t immediately let go –> does not paste

      Is this what you’re experiencing? If so, then that’s probably normal.

      • I do not think that is what he meant. I guess I am having the same problem as Andrew. In Ubuntu as in other linux distros, the middle mouse button pastes the selection. Since I exclusively rely on the middle-button to scroll documents, I often end up accidentally pasting texts. Especially when in a text environment I find it extremely disturbing as I am not used to this paste behavior and also it is pretty awkward. I wonder if there is any way to disable this paste feature.

          • Thanks for the response Eastwood.

            If I don’t let go of the button, as you previously said, it works as a scroll. But if I let it go by accident, which so frequently happens to me, it pastes some text that I happened to have highlighted before mostly without a purpose. There are several problems with this middle-button paste feature: 1) you need to always be careful at what you are highlighting, you must not do it idly. 2) when you’re using the scroll feature of the middle button, you need to make sure you don’t let go of it in, however, this happens a lot by accident or carelessness when you’re using the middle button to scroll on a laptop like x61(you have to use the trackpoint) 3) and when you do it by accident, you sometimes have to look for in the middle of the whole document some random text you pasted.

            I’ve found this link though I am not sure if it breaks my current configuration(which is based on your above workaround): http://askubuntu.com/questions/4507/how-do-i-disable-middle-mouse-button-click-paste

  6. Excellent! This worked for me on Linux Mint 9 the first time. I had already slogged around the Mint forums and tried lots of different things. Your’s worked great! thanks.

  7. Well I tested the above config and my whole keyboard stops working!? I’m using R61. What could be the problem? Any ideas how to debug it?

    Thank you in advance.

  8. Pingback: Half a Page of Scribbled Linux :: Thinkpad T60 Ubuntu Upgrade

  9. I can’t get this work, after the second command, which I paste the lines to nano, then tried to use ctl+o to save the file it said error in writing this file = no such file or directory.

    So I’m wondering how to save it.

    Thanks!

  10. Man! This actually worked! Thank you!

    Oh by the way I’m using Linux Mint. Tried several methods before but they didn’t work.

  11. Works great. I scrolled to the bottom of this page with it. I’m using a T42p. One weird thing was some bizarre screen distortion before auto-login. Hopefully it goes away.

  12. Works great on my T400. Thanks.

    Scrolls left, right, up, and down. Clicking briefly does paste, while holding it down a little longer doesn’t paste.

  13. Scroll works fine on my R51, but the middle button still pastes. I was hoping to get rid of that feature, because it annoys me. Still, I’m happy to have my scroll button back.

    *** Update:

    Okay, I’ve been playing with this for a while now, and I have figured out how to BOTH turn off the irritating paste function AND still be able to scroll with the third button. It’s really quite easy. Just insert a line to Eastwood’s 20-thinkpad.conf file shown above that says:

    Option “ButtonMapping” “1 0 3 4 5 6 7″

    I inserted it just above EndSection in mine. Then save and reboot.

    Setting that second digit to 0 changes the button mapping for the center (2nd) button at startup. I was afraid it would completely disable the center button, but I was pleasantly surprised when I rebooted and had my R51′s buttons behaving exactly as they did under Windows. It scrolls, but there’s no more annoying paste!

    (And yes, I know that paste function is normal. But the whole point of Linux is to be able to make my machine do what I want rather than what some huge corporation wants me to want. I want the center button to scroll without pasting, and now I have it.)

  14. Pingback: ThinkPad middle button scroll Ubuntu 10.10 Maverick | Andreas

  15. On a Thinkpad T400 with Ubuntu 10.10, this is the solution that worked for me, not the gpointing-device-settings application. Except I had to change the path to:

    /usr/share/X11/xorg.conf.d

    Thanks for the post!

  16. This worked on my T510 running Ubuntu 10.9. Like Mustafa and others, when I upgraded to 10.10, I had to move the file to the following directory:

    /usr/share/X11/xorg.conf.d

    Thanks a lot!

  17. Excellent thank you
    Enable Restart X server (Ctrl-Alt-BackSpace)

    Enabling Ctrl-Alt-Backspace for Ubuntu 10.10

    * Select “System”->”Preferences”->”Keyboard”
    * Select the “Layouts” tab and click on the “Layout Options” button.
    * Select “Key sequence to kill the X server” and enable “Control + Alt + Backspace”.

    Enabling Ctrl-Alt-Backspace for Kubuntu 10.10

    * Click on the Application launcher and select “System Settings”
    * Click on “Regional & Language”.
    * Select “Keyboard Layout”.
    * Click on “Enable keyboard layouts” (in the Layout tab).
    * Select the “Advanced” tab. Then select “Key sequence to kill the X server” and enable “Control + Alt + Backspace”.

  18. First off, thank you!

    for t400 users using 11.04 I also needed to move the file to:

    /usr/share/X11/xorg.conf.d/20-thinkpad.conf

    best of luck

  19. Works like a charm on X61s and T500 with Mint 11. Thank you for a very easy and straightforward tutorial. It has saved me many times.

  20. Works on my X60 Tablet. Wonderful. Just upgraded from 10.0.4 to 11.04 and…wow, 20min overall install time, great look, everything works out of the box, this little tweak was the only I noticed was necessary…they even fixed the button problem of by wacom pen (button on pen was mapped to middle instead right button).

  21. Thanks! Worked for my T60p just fine.
    A small tip – you don’t need to restart your computer, just log out and back in again or reload the x-11 common from init.d.

  22. I have recently switched to 11.10 (fresh install) and I am able to use the middle scroll button on my X61s without making the above changes to my system. Just wanted to report that.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>