26 September 2008

Scrolling with the Thinkpad's TrackPoint in Ubuntu

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!

89 comments:

Hobbes said...

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

TheTacticalNuke said...

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

Anonymous said...

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?

Phil said...

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.

Bryan Cristina said...

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...

Anonymous said...

Thanks!

Felipe said...

Thanks for this very nice tip. It works perfectly!

arniealmighty said...

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?

Adi said...

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?

Phil said...

Looks like it's related to Ubuntu bug 282387.

adder1972 said...

Great tip! Thanks!

pawel said...

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

Anonymous said...

THANKS!!!

Juice said...

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

Anonymous said...

I think there's a typo in ZAxsisMapping

Anonymous said...

Thanks a lot, this worked for me too :)

Anonymous said...

This works! Thank you!

Anonymous said...

it works in R31. Thanks a lot.

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

Anonymous said...

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!

fer said...

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?

Bashar said...

thats true, it doesn't work for X300

Bashar said...

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

Justin Watt said...

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.

Anonymous said...

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

UbuntuFan said...

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.

Pieter Hintjens said...

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

Traspler said...

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...

Anonymous said...

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

Anonymous said...

Worked for me on T42, thanks!

Anonymous said...

Worked for me on T41, thanks!

Skory said...

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"

Bashar said...

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

Anonymous said...

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 :)

petitchevalroux said...

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

Ennis said...

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

Ennis said...

Also, Restart X by ctrl-alt-backspace

Anonymous said...

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?

Phil said...

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

CookieofDoom said...

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

William P. said...

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?

Phil said...

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

Dominik Wujastyk said...

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

Anonymous said...

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

Anonymous said...

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

Anonymous said...

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

Anonymous said...

works for me on a T61p. Thank you.

But how do I make the pointer movement faster?

Anonymous said...

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.

Phil said...

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.

TYB said...

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

Regards!

Anonymous said...

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

Sven said...

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

Bye
Sven

Slavo said...

Thanks! Works like charm on my R61i ! :)

momodi said...

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

Riyad said...

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

Alig said...

Thanks a lot!
Works perfectly on a T60p!

Mocca007 said...

Thank you!!!!!!!! Worked perfect on my T43!!!!

Edward said...

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

Mark said...

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

Anonymous said...

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

Any ideas?

livefields said...

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

Anonymous said...

Works perfect on my T60 with 9.04!
Thanks

Cristian

Anonymous said...

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

Troels-Henrik B. Krag said...

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

Troels-Henrik B. Krag said...

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

Anonymous said...

thanks, worked perfectly for me on 9.04 with a sl500

Anonymous said...

thanks!
works on my x200s with ubuntu 9.04

etieleq said...

Hi,

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

Anonymous said...

technique worked on my r31.

thank you so much.

Anonymous said...

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

Omar said...

Worked fine with my T61 and ubuntu 9.04

Thank you

Anonymous said...

Thanks worked for me too, t61 and 9.04

Frank@HK said...

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

Theijo said...

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

thomas said...

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

Anonymous said...

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

Станислав said...

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.

Ruchir said...

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...

Anonymous said...

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

xiroV said...

Thanks for the fix! Works perfectly!

Anonymous said...

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

nilss said...

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

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

Ke said...

Thanks! Really appreciate the fix <3

Carson B said...

Works perfectly on Ubuntu 9.04 on a ThinkPad X200s.

Thanks a lot!!

hiroaki said...

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

immeëmosol said...

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

Phil said...

@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.

daniel said...

thanks works perfectly
UBUNTU 9.10 on IBM T40 Type 2373

Søren said...

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

Anonymous said...

THANKS works on my SL500 + 9.10 Karmic

Post a Comment