Scrolling with the Thinkpad's TrackPoint in Ubuntu

Update: for instructions for Ubuntu Lucid/10.04 see this post.

Update: note, these instructions work for me on Ubuntu 8.10 Intrepid as well as 9.04 Jaunty and 9.10 Karmic on a Thinkpad X61s. Alternatively, the Karmic repos have gpointing-device-settings, a GUI tool for enabling trackpoint scrolling (as well as other special trackpoint/touchpad features).

Ubuntu GNU/Linux 8.10 (Intrepid) switches to evdev for X server input, which has the unfortunate side effect of breaking old EmulateWheel configurations. So scrolling using the middle button + TrackPoint (which I absolutely love) was broken for a while, although it is now fixed. Instead of modifying your xorg.conf, create a new file called /etc/hal/fdi/policy/mouse-wheel.fdi with the following contents:

<match key="info.product" string="TPPS/2 IBM TrackPoint">
 <merge key="input.x11_options.EmulateWheel" type="string">true</merge>
 <merge key="input.x11_options.EmulateWheelButton" type="string">2</merge>
 <merge key="input.x11_options.XAxisMapping" type="string">6 7</merge>
 <merge key="input.x11_options.YAxisMapping" type="string">4 5</merge>
 <merge key="input.x11_options.ZAxisMapping" type="string">4 5</merge>
 <merge key="input.x11_options.Emulate3Buttons" type="string">true</merge>
</match>

(Based on code from Michael Vogt and adapted to support both vertical and horizontal scrolling.)

Update: you'll have to restart hal and gdm, and remove the cache file /var/cache/hald/fdi-cache, for the changes to take effect. Log in on a VT (e.g. with Ctrl+Alt+F1) and then do:

sudo rm /var/cache/hald/fdi-cache
sudo /etc/init.d/hal restart
sudo /etc/init.d/gdm restart

(Be sure to log in on a console/VT, because restarting GDM will kill all your X apps...)

Note for Ubuntu 8.10 users only: an update to Ubuntu Intrepid (subsequent to my original post) breaks TrackPoint scrolling either completely or possibly only after suspending and resuming. A comment on Ubuntu bug 282387 gives instructions for downloading and installing a fixed version from upstream:

sudo apt-get install build-essential git-core
sudo apt-get build-dep xserver-xorg-input-evdev
git clone git://git.freedesktop.org/git/xorg/driver/xf86-input-evdev
cd xf86-input-evdev
git reset --hard 5f2c8a2dcdf98b39997ee5e7c9a9ace3b640bfa3
./autogen.sh --prefix=/usr
make
sudo make install

Later releases already have a fixed version of xserver-xorg-input-evdev.

Feedback/testing: I've tested the policy file and workaround above on an X61s. On 8.04/Intrepid, people have indicated that it seems to work on most or all R and T series Thinkpads as well as the X31, X40, X61, and X200. The X300 and X301 Thinkpads seem to have different TrackPoint hardware. On those machines you may need to disable the touchpad in the BIOS to make the above workaround work.

Thanks to all the commenters below who left additional tips for getting this to work and providing feedback on what hardware is supported!

101 comments:

  1. Thank you thank you thank you thank you! Works like a charm

    ReplyDelete
  2. Hey, thanks for your post about how to fix the trackpoint with Ubuntu 8.10. I really appreciate it.

    ReplyDelete
  3. This is great news. I came here through https://bugs.launchpad.net/ubuntu/+source/xorg/+bug/251408

    Do you know if there is any way to activate "press-to-select" in interepid? Is it different too?

    ReplyDelete
  4. Sorry, I don't know about configuring tap-to-select. From a cursory reading of ThinkWiki it looks to be unrelated to this xorg.conf/evdev business, though.

    ReplyDelete
  5. I've been cursing my upgrade since I couldn't scroll.. Thanks so much, my thinkpad is slightly less maddening now. Onto LCD brightness controls...

    ReplyDelete
  6. Thanks for this very nice tip. It works perfectly!

    ReplyDelete
  7. this suddenly stopped working for me on intrepid. Looking at HAL's information about the trackpoint, all those properties seem to have been set, so that fdi script is definitely run.

    Any pointers?

    ReplyDelete
  8. Same here. After a suspend, the scrolling isn't working anymore. I put the above script into /etc/hal/fdi/policy
    Does anybody have an idea?

    ReplyDelete
  9. I've a complete newbie question: On my new Lenovo X301 there is no such a device when listing with xinput. Instead I have a "DualPoint Stick" which I configure with the file from your blog. However this dosn't help at all.. I'm using ubuntu 8.10 and I've already disabled & enabled the TrackPoint in BIOS. When listing the input properties with xinput I get:

    Device 'DualPoint Stick':
    Device Enabled: 1
    Middle Button Emulation: 1
    Middle Button Timeout: 50
    Wheel Emulation Inertia: 10
    Wheel Emulation: 1
    Wheel Emulation X Axis: 6, 7
    Wheel Emulation Y Axis: 4, 5
    Wheel Emulation Timeout: 200
    Wheel Emulation Button: 2
    Drag Lock Buttons: 0

    But still the scrolling with the stick doesn't work. What can I do next?
    Thanks,
    pawel

    ReplyDelete
  10. I promise you this works.

    This works, but I had to restart my computer first.

    Also,
    If your scrolling stops working after suspend, like mine did, this is how you can fix it:
    __________________________________________________
    sudo apt-get install build-essential git-core

    sudo apt-get source xserver-xorg-input-evdev # You can delete the stuff it downloads to your working directory, this is only to get all the build dependencies

    git clone git://git.freedesktop.org/git/xorg/driver/xf86-input-evdev

    cd xf86-input-evdev

    git reset --hard 5f2c8a2dcdf98b39997ee5e7c9a9ace3b640bfa3

    ./autogen.sh --prefix=/usr

    make

    sudo make install
    -------------------------------------------

    This was taken from this bug report:
    https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-input-evdev/+bug/282387

    ReplyDelete
  11. I think there's a typo in ZAxsisMapping

    ReplyDelete
  12. Thanks a lot, this worked for me too :)

    ReplyDelete
  13. This works! Thank you!

    ReplyDelete
  14. it works in R31. Thanks a lot.

    the difference is there 's no icon change when the mid button and tk red point pressed.

    ReplyDelete
  15. Hi, it doesn't work for me completely. I always have to move the cursor over the scroll bar (on the right) where it works and then I can move anywhere... Any help? THanks!

    ReplyDelete
  16. Works fine on my T61 and Intrepid even after suspend and resume.
    For those trying to activate "press-to-select" in Intrepid. I make it work installing "Configure Trackpoint" from here:
    http://tpctl.sourceforge.net/configure-trackpoint.html
    You may need to install sysfsutils before: sudo apt-get install sysfsutils.
    Configure Trackpoint will also let you configure speed and sensibility.
    Anyway STILL trying to make it work Fn+F8 to disable/enable Touchpad. Used to work editing /etc/X11/xorg.conf and adding Option "SHMConfig" "true" but no longer works in Intrepid.
    Anyone?

    ReplyDelete
  17. thats true, it doesn't work for X300

    ReplyDelete
  18. ok i finally got it working on X300

    you need to disable the touch pad from bois then the trackpoint will show as "TPPS/2 IBM TrackPoint" instead of "DualPoint Stick" when using the command 'xinput list-props 3'

    now i can scroll :D

    Thanks guys

    ReplyDelete
  19. Phil, thanks for the post, I tried it out on my X200 after upgrading from Hardy to Intrepid today and it worked like a charm. Just FYI.

    ReplyDelete
  20. Hi there, doesn't work (very well) on my Thinkpad x61s...

    ReplyDelete
  21. I am using a X60 and the code here works to get the scrolling but I lose it after a suspend. I followed the insturctions posted by Juice and I get an error when I execute commands:

    ./autogen.sh --prefix=/usr

    make

    sudo make install

    I went looking for the file autogen.sh and the make file. I can't find either of them in the extracted folder.

    ReplyDelete
  22. Pieter Hintjens11/06/2008 11:58 AM

    On an X60, scrolling stops working after suspend/resume. The autogen.sh command fails with:

    ./configure: line 11657: syntax error near unexpected token `XINPUT,'
    ./configure: line 11657: `XORG_DRIVER_CHECK_EXT(XINPUT, inputproto)'

    ReplyDelete
  23. Any suggestios how to get it working on a X200 (8.10 all updates)? Some see mto be able to use the scrolling with this but I can't... The scrolling is one of the last big "To Fix" things on my X200 list before I switch to ubuntu completely...

    ReplyDelete
  24. Hey thanks a lot. Works on for me on my T60!

    ReplyDelete
  25. Worked for me on T42, thanks!

    ReplyDelete
  26. Worked for me on T41, thanks!

    ReplyDelete
  27. This only worked for me on my X61 running 64-bit Intrepid after downloading this:

    http://launchpadlibrarian.net/19254960/preinit.diff

    and then following these instructions:

    https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-input-evdev/+bug/282387/comments/36

    you may have to replace the line
    "./autogen --prefix=/usr"
    with
    "./autogen.sh --prefix=/usr"

    ReplyDelete
  28. fer,
    did you manage to make touchpad enable/disable using Fn+F8 ?

    also anyone knows if touchpad can work for horizontal scrolling with firefox?

    thanks

    ReplyDelete
  29. Hi there...

    I've just installed 8.10 and had problems with getting my trackpoint scrolling working properly. Yeah, it worked, but only after I turned off touchpad in BIOS, what I didn't want to do.
    There is another solution - you can easily turn off whole evdev system and get back to 8.04 way of loading drivers for input devices... You just have to add to your xorg.conf such a section:

    Section "ServerFlags"
    Option "AutoAddDevices" "False"
    EndSection

    ... then add sections for keyboard and trackpoint (I used to have it under "configured mouse" section) like it was in 8.04... and it should work :)

    ReplyDelete
  30. Thanks a lot Phil this tips works on my X31. By the way I did a french post based on yours on my website here : Configurer le scroll sur son thinkpad

    ReplyDelete
  31. This works for x40 and intrepid 8.10..

    First install libtool (and anything else not found) then
    sudo apt-get build-dep xserver-xorg-input-evdev
    apt-get source xserver-xorg-input-evdev
    cd xserver-xorg-input-evdev-2.0.99+git20080912
    wget http://launchpadlibrarian.net/19254960/preinit.diff
    patch -p1 < ./preinit.diff
    ./autogen.sh --prefix=/usr
    make
    sudo make install

    ReplyDelete
  32. Also, Restart X by ctrl-alt-backspace

    ReplyDelete
  33. Sorry for stupid question... But how can I restart hal and gdm... is it enough to create that file? I have an X60 and tried to create that file (correcting the typo in ZAxismapping...) but I'm stuck it won't work... Could someone post a more easy guide for ppl just starting ubuntu experience?

    ReplyDelete
  34. petitchevalroux: Awesome!
    Anonymous: I've updated the post to, among other things, add instructions for restarting HAL and GDM.

    ReplyDelete
  35. Thanks a lot! This worked great on my X61... it's also nice to know that Jaunty will work better.

    ReplyDelete
  36. Greetings. I am new to Ubuntu and when trying the method above I got the following message:

    "Could not save the file /etc/hal/fdi/policy/mouse-wheel.fdi
    You do not have the permissions necessary to save the file. Please check that you typed the location correctly and try again."

    Does anyone know how to over come this objection?

    ReplyDelete
  37. William P: you need to become root before editing the file, e.g. edit with "gksudo gedit".

    ReplyDelete
  38. Worked on a T500. Thanks!

    It also survived a suspend.

    I'm using Intrepid 8.10 with the "proposed updates" and 2.6.27-11-generic kernel that has the suspend/hibernate fixes in it.

    Best,
    Dominik

    ReplyDelete
  39. The following worked for my X61, ubuntu 8.10

    Add the following to /etc/X11/xorg.conf

    Section "InputDevice"

    Identifier "Mouse1"

    Driver "mouse"

    Option "Protocol" "ExplorerPS/2" # IMPS/2 is not recommend for TrackPoints

    Option "Device" "/dev/input/mice"

    Option "EmulateWheel" "on"

    Option "EmulateWheelTimeout" "200"

    Option "EmulateWheelButton" "2"

    Option "YAxisMapping" "4 5"

    Option "XAxisMapping" "6 7"

    EndSection

    Section "Monitor"
    Identifier "Configured Monitor"
    EndSection



    Restart X by pressing ctrl-alt-backspace and voila!

    Good luck, y'all

    ReplyDelete
  40. The preinit patch worked on Thinkpad W500.
    Thanks a lot!

    ReplyDelete
  41. Thank you so much. I've been wincing every time i've tried to scroll for almost a month.

    ReplyDelete
  42. works for me on a T61p. Thank you.

    But how do I make the pointer movement faster?

    ReplyDelete
  43. sorry, I should have also mentioned my OS:
    I'm running Ubuntu:

    2.6.28-8-generic #26-Ubuntu SMP x86_64 GNU/Linux

    I did a clean install and basic trackpoint functions worked out of the box. But middle button scrolling did not. Thanks to this post, it works now.

    I still need to find a way to make the movement faster.

    ReplyDelete
  44. Anonymous,
    I'm not sure if there is an X configuration option for this, but I just use GNOME's Mouse control panel to change the pointer speed.

    ReplyDelete
  45. I just wanted to let you know that I just tested this in my T43 and works just fine.

    Regards!

    ReplyDelete
  46. Thanks, scrolling works like a charm on my T500 with this! I still need to find a way to disable the touchpad though... ;)

    ReplyDelete
  47. Thank you very much. Works here without rebuilding xf86-input-evdev on Intrepid. :-)

    Bye
    Sven

    ReplyDelete
  48. Thanks! Works like charm on my R61i ! :)

    ReplyDelete
  49. er...
    It didn't worked on my x200(ubuntu 9.04 beta)

    ReplyDelete
  50. You are a fantastic human being -- tip much appreciated and I'm much happier on Jaunty now with my T60 -- thank you!

    ReplyDelete
  51. Thanks a lot!
    Works perfectly on a T60p!

    ReplyDelete
  52. Thank you!!!!!!!! Worked perfect on my T43!!!!

    ReplyDelete
  53. Outstanding! Worked beautifully on my T60p (Intrepid) with the Jan 4, 2009 update.

    ReplyDelete
  54. This somehow does not work on my X200 with Ubuntu 9.04 RC.

    ReplyDelete
  55. This does not work on R50e with Ubuntu 9.04, but it worked with 8.10

    Any ideas?

    ReplyDelete
  56. Worked perfect on my X300 under 8.10 but now under 9.04 doesn't work anymore :-(

    ReplyDelete
  57. Works perfect on my T60 with 9.04!
    Thanks

    Cristian

    ReplyDelete
  58. Works like a charm on an X60 with Jaunty (9.04)

    ReplyDelete
  59. It sort of works on T41p however tends to act a bit strange in Opera Internet Browser; when reaching the end of a page (that is: top or bottom) the browser will treat it as a 'back' or 'forward' command. Strange! That is only the case for the trackpoint and not the touchpad - and only in Opera...
    9.04

    ReplyDelete
  60. ...which I of course fixed by removing the x-axis parameter from the code.
    Ubuntu 9.04, Opera 9.64.

    ReplyDelete
  61. thanks, worked perfectly for me on 9.04 with a sl500

    ReplyDelete
  62. thanks!
    works on my x200s with ubuntu 9.04

    ReplyDelete
  63. Hi,

    If it doesn't work, check this:
    http://duncanelliot.com/blog/?p=22

    ReplyDelete
  64. technique worked on my r31.

    thank you so much.

    ReplyDelete
  65. x31 -> just perfect! - i love you man :)

    ReplyDelete
  66. Worked fine with my T61 and ubuntu 9.04

    Thank you

    ReplyDelete
  67. Thanks worked for me too, t61 and 9.04

    ReplyDelete
  68. For those who does not work,
    remove /var/cache/hald/fdi-cache and restart,
    it works for me, T43 9.04

    ReplyDelete
  69. Thank you for the fix for the ubuntu bug! This fix works for my Thinkpad SL400.

    ReplyDelete
  70. Worked on my X31 with Kubuntu 9.04 Jaunty, but only after removing /var/cache/hald/fdi-cache (thanks to OP and comments above)

    ReplyDelete
  71. great way! Formally i had it in xorg.conf and struggled with Firefox doing the scrolles. Now it seames to be ok.

    Best trackpoint scrolling by now.

    Thinkpad R51, Ubuntu Jaunty

    ReplyDelete
  72. Thank U a lot. It worked after hours of fighting!
    I'm using Ubuntu 9.04 on ThinkPad R61 and I had to disabled the TrackPad in the BIOS in order the scrolling with trackpoint to work.

    ReplyDelete
  73. thanks worked for me...

    but when i gave the second command for restart it said it was shutting down GNOME display manager... then the screen went away and i was left with a cursor and some commands...

    when i powered down and restarted again it works fine...

    ReplyDelete
  74. Just wanted to comment that this fixes the problem under Fedora 10 and Fedora 11 as well. Thanks!

    ReplyDelete
  75. Thanks for the fix! Works perfectly!

    ReplyDelete
  76. Thanks man! This rocks! Works for my T43. Luv the scrolling...

    ReplyDelete
  77. Here's a quick way to activate scrolling without restarting X:

    sudo /etc/init.d/hal restart
    sudo rmmod psmouse
    sudo modprobe psmouse

    ReplyDelete
  78. Thanks! Really appreciate the fix <3

    ReplyDelete
  79. Works perfectly on Ubuntu 9.04 on a ThinkPad X200s.

    Thanks a lot!!

    ReplyDelete
  80. works perfectly on ubuntu 9.04 64bit on a ThinkPad T61 after removing /var/cache/hald/fdi-cache. many thanks from japan

    ReplyDelete
  81. So now on karmic (and maybe earlier ubuntu-versions as well), I can do this with a graphical tool called: gpointing-device-settings .
    To install from terminal type : #
    aptitude install gpointing-device-settings
    OR from normal account with root-privileges : $
    sudo aptitude install gpointing-device-settings
    another option might be to press Alt+F2 (run dialog) and to type the following in that box :
    gksudo aptitude install gpointing-device-settings
    OR maybe this uri works :
    apt://gpointing-device-settings

    ReplyDelete
  82. @immeëmosol: thanks a lot; that's awesome and will be a big help for many. I've added a note to the top of the page.

    ReplyDelete
  83. thanks works perfectly
    UBUNTU 9.10 on IBM T40 Type 2373

    ReplyDelete
  84. Excellent post! You're the hero of the internet. Worked after restart on my X200.

    ReplyDelete
  85. THANKS works on my SL500 + 9.10 Karmic

    ReplyDelete
  86. work greatly, thanks a lot

    ReplyDelete
  87. I'm so happy to have my scroll back!!1

    ReplyDelete
  88. Oh thank you so much for posting this. It works for me on my T40 with Ubuntu 9.10

    ReplyDelete
  89. For the lenovo "ThinkPad USB Keyboard with TrackPoint" change the identifier:
    string="TPPS/2 IBM TrackPoint">
    to
    string="Lite-On Technology Corp. ThinkPad USB Keyboard
    with TrackPoint">

    or whatever the device is labelled from:

    more /proc/bus/input/devices

    ReplyDelete
  90. This worked perfect on my X61 tablet. Thanks!!
    ps. if you get stuck in console after pressing (ctrl+alt+f1), to get out hit (ctrl+alt+delete)

    ReplyDelete
  91. Thanks immeëmosol the gpointing-device-settings worked for me. Just needed to change to button 2 and I can now scroll with the middle button and the pointer!

    I am using Ubuntu 9.10 and a T43.....

    ReplyDelete
  92. Hello,
    I bought the Thinkpad USB keyboard with track located at http://www.amazon.com/gp/product/B002ONCC6G/ref=oss_product and i'm trying to configure the trackpoint to work the same as its working on my W500

    How do i identify the mouse so i can add one more entry for it at /etc/hal/fdi/policy/mouse-wheel.fdi ? i tried to copy:

    true
    2
    6 7
    4 5
    4 5
    true


    and change the 2 to 3 in the first line but that disabled both of the trackpoints to scroll

    true
    2
    6 7
    4 5
    4 5
    true



    any advise?

    Best Regards,

    ReplyDelete
  93. pasting tags didn't work so im putting them at http://pastebin.com/AVJXfMjq

    ReplyDelete
  94. @Bashar: I don't think you have to change the numbers, just the device name, per this page: http://psung.blogspot.com/2009/09/new-external-thinkpad-keyboard.html

    ReplyDelete
  95. Perfect.
    It worked big "Thank you" to you.

    ReplyDelete
  96. Disabling the touchpad in bios fixed it.

    Isn't there a way to modify the instructions to work with both of them enabled?

    Thanks for the info btw.

    ReplyDelete
  97. Hello there,

    I tried doing this on Lucid Linux (10.04) but it doesn't seem to be working. I could not restart hal (it says command not found) there is no hal in init.d (but there is hald)

    I am a noob in linux but please let me know if I am missing something. I am using it on SL 500. (and my trackpoint works perfect on windows 7)

    ReplyDelete