One of the major reasons for using ThinkPad is that iconic red TrackPoint thing, which allows the control of cursor without leaving the keyboard. However, when I install Linux on a new ThinkPad, scrolling often does not work out of the box. There are several ways to do this, but my preferred way is to use xinput:
$ sudo aptitude install xinput
See what event ID is associated with TrackPoint:
$ xinput list
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ SynPS/2 Synaptics TouchPad id=11 [slave pointer (2)]
⎜ ↳ TPPS/2 IBM TrackPoint id=13 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ Power Button id=6 [slave keyboard (3)]
↳ Video Bus id=7 [slave keyboard (3)]
↳ Sleep Button id=8 [slave keyboard (3)]
↳ Integrated Camera id=9 [slave keyboard (3)]
↳ AT Translated Set 2 keyboard id=10 [slave keyboard (3)]
↳ ThinkPad Extra Buttons id=12 [slave keyboard (3)]
↳ ACPI Virtual Keyboard Device id=14 [slave keyboard (3)]
The TrackPoint’s ID is 13 in my current configuration.
$ xinput --set-prop --type=int --format=8 13 "Evdev Wheel Emulation" 1 $ xinput --set-prop --type=int --format=8 13 "Evdev Wheel Emulation Button" 2 $ xinput --set-prop --type=int --format=8 13 "Evdev Wheel Emulation Axes" 6 7 4 5
The change should be noticeable immediately; moving TrackPoint while pressing down the blue middle button right below the space bar acts as scroll, both vertically and horizontally.
I can also do this automatically on start-up by having the same lines in ~/.xsessionrc (create this file if it does not already exist):
#!/bin/bash
# extract device id
s=`xinput | grep TrackPoint`
s="${s#*id=}"
id="${s%%[!0-9]*}"
xinput --set-prop --type=int --format=8 "$id" "Evdev Wheel Emulation" 1
xinput --set-prop --type=int --format=8 "$id" "Evdev Wheel Emulation Button" 2
xinput --set-prop --type=int --format=8 "$id" "Evdev Wheel Emulation Axes" 6 7 4 5
Note that the device ID may change depending on the environment (e.g., attaching USB mouse on boot, disabling graphics card, etc.), so this kind of automation is useful and prevents WTF moments when you notice TrackPoint scrolling suddenly stops working.
Now that TrackPoint can be used for scrolling, I see little reason to enable TrackPad (I think I have a mild case of hyperhydrosis, so I have developed aversion to thermally sensitive touch/track pad). TrackPad can be disabled in BIOS to save power consumption as well as to prevent accidentally touching it with my palms while typing.
ThinkPad X1 Carbon (3rd Gen/2015)
I’m on Debian/Jessie now with my first X1 Carbon (thank goodness Lenovo reverted to physical TrackPad buttons), and for this setting, my ~/.xsessionrc looks like this:
#!/bin/bash
# extract device id
s=`xinput | grep "PS/2 Synaptics TouchPad"`
s="${s#*id=}"
id="${s%%[!0-9]*}"
xinput --set-prop --type=int --format=8 "$id" "Evdev Wheel Emulation" 1
xinput --set-prop --type=int --format=8 "$id" "Evdev Wheel Emulation Button" 2
xinput --set-prop --type=int --format=8 "$id" "Evdev Wheel Emulation Axes" 6 7 4 5
Pingback: Installing Debian Wheezy on Lenovo T420 | Biboroku
Hi !
Thanks a lot for all your very useful articles. They helped me a lot to get a nice Wheezy setup on my T430s.
However, I could get your .xsessionrc script to work. When running the script on its own (./xsessionrc) it works, but when I’m running “startx” it doesn’t. It’s probably related to the order of execution of the different scripts and may depend on your system/desktop manager etc.
So, I’ve searched for a workaround and found this one that worked (even if, I know, it’s less dynamic than your code) :
#!/bin/bashxinput --set-prop --type=int --format=8 "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation" 1
xinput --set-prop --type=int --format=8 "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation Button" 2
xinput --set-prop --type=int --format=8 "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation Axes" 6 7 4 5
I hope it could help other people that may get this issue.
Cheers!
Dorian — Thanks for your comment. Does that actually work? If so, your solution may actually be more dynamic in the sense that it would always identify the TrackPoint properly without doing hack-ish parsing as in the original script. Should try this myself.
In any case, thanks for the useful tip.
There is a much better way. Just add a custom X config. This way, you don’t have to worry about device names, you don’t have to worry about properly launching a script at startup, and it’s portable. Just copy the config over to a new machine (I have it saved & backed up):
#
# Thinkpad Trackpoint Fix
# copy to /usr/share/X11/xorg.conf.d/20-thinkpad.conf
Section "InputClass"
Identifier "Trackpoint Wheel Emulation"
MatchProduct "TrackPoint"
MatchDevicePath "/dev/input/event*"
Driver "evdev"
Option "EmulateWheel" "true"
Option "EmulateWheelButton" "2"
Option "Emulate3Buttons" "false"
Option "XAxisMapping" "6 7"
Option "YAxisMapping" "4 5"
EndSection
Even though I used code tags, wordpress ignored formatting. Everything between, but not including, ‘Section “InputClass”‘ and ‘EndSection’ should be indented (my file has 8 space indentation).
Jacob — This would be a better system-wide solution if valid, but I read somewhere that X is moving away from using xorg.conf at all, so this kind of hard-coding is actually discouraged and may be deprecated at some point. I may be wrong though; I think that was when I was configuring Debian Squeeze…
In fact, I used to configure everything like you did, except it was in /etc/X11/xorg.conf, but since then I have tried not to touch the file (it’s empty now). Perhaps /usr/share/X11/xorg.conf.d is a new way?
Thanks a lot for that stuff. It’s great to be able to make full use of the button now. I ended up using Jacob’s solution, since that’s the traditional way to configure X devices. I don’t think xorg.conf is either discouraged or likely to be deprecated; it’s just not needed any more for most setups.
I got this working under a ThinkPad T30 running waldorf.
Total linux noob here, thanks for the guide!!
The system wide x solution mentioned before works well here. For linux novices here is the detailed description for debian based systems:
1. create a file in /usr/share/X11/xorg.conf.d/60-trackpoint-scroll.conf with the following command:
sudo gedit /usr/share/X11/xorg.conf.d/60-trackpoint-scroll.conf2. Copy the properly indented content of Jacob’s reply into the file and save the file:
#
# Thinkpad Trackpoint Fix
# copy to /usr/share/X11/xorg.conf.d/20-thinkpad.conf
Section "InputClass"
Identifier "Trackpoint Wheel Emulation"
MatchProduct "TrackPoint"
MatchDevicePath "/dev/input/event*"
Driver "evdev"
Option "EmulateWheel" "true"
Option "EmulateWheelButton" "2"
Option "Emulate3Buttons" "false"
Option "XAxisMapping" "6 7"
Option "YAxisMapping" "4 5"
EndSection
3. restart X by logging out and back in. If that doesn’t work, restart the computer.
I also tried to indent the contents of the file correctly, but as Jacob points out, indenting doesn’t seem to work properly on this blog. Remember to indent all lines except the first and last line with a character or some spaces as Jacob pointed out in his post, otherwise it will not work!
Thanks!
Noob here.
Did it on my thinkpad x60s with the crunchbang distro and it worked!
I followed the instructions to enable TrackPoint immediately, but when I created the .xsessionrc file as directed, my system didn’t autologin, and wouldn’t let me log in either. By rebooting into recovery mode and deleting that file, I was able to recover my system, but my changes weren’t saved, as expected. Users of Point Linux (Based on Debian Wheezy) beware.
Travisyard — Thanks for the comment. It might be something simple as mal-formed config file.
Thanks for your great work, as you know there is no package “gpointing-device-settings_1.5.1-6_amd64.deb” on Jessie Dabian, so this little and nice script hepled me.
Awesome help!
Thank you so very much!
Got the scrolling-middle-button-with-trackpoint feature of my ThinkPad T530 back for good at Debian 8.4!
Even after reboots, with your ~/.xsessionrc file modification/creation guidance.
I didn’t have the file so I just created it in the home directory.
Scrolling works great and for good now!
Thanks again!
Hey, nice tutorial!
but i have a problem:when i have selected text and press middle button to scroll up or down, the text gets copied in Debian.. How can i fix this? Thanks!
Luis — I don’t experience the same issue with copy & pasting, as you don’t actually have to press down the TrackPoint in order to do scrolling.
To tweak the behavior to your liking more, I’d consult more generic documentation on how to configure TrackPoint:
http://www.thinkwiki.org/wiki/How_to_configure_the_TrackPoint#Configuration_using_xinput