Difference between revisions of "How to configure the TrackPoint"

From ThinkWiki
Jump to: navigation, search
m (TrackPoint under Ubuntu 8.10 using HAL: Remove duplicate line)
 
(122 intermediate revisions by 52 users not shown)
Line 1: Line 1:
 
{| width="100%"
 
{| width="100%"
 
|style="vertical-align:top;padding-right:20px;width:10px;white-space:nowrap;" | __TOC__
 
|style="vertical-align:top;padding-right:20px;width:10px;white-space:nowrap;" | __TOC__
|style="vertical-align:top" |The [[Patch to enable advanced trackpoint configuration|kernel trackpoint driver]] is controlled by echoing values to special files. Common configuration options are outlined below.
+
|style="vertical-align:top" |Below are several ways of configuring the kernel psmouse driver for controlling extended TrackPoint features.
 +
|}
 +
On a '''Modern''' distribution (like Fedora, Ubuntu or OpenSUSE) you will want to use xinput or one of the graphical front ends. For distributions that are lagging a bit (e.g. Debian Lenny and PCLOS '09) you may still want to use the old xorg config method.
 +
 
 +
=Configuration using xinput=
 +
If you want to modify changes on the fly, you can do so with {{cmd|xinput|}} (part of the optional xorg-x11-apps rpm on Fedora).
 +
Note that these changes are not saved when the xserver is restarted. However, you can add the lines e.g. in your  {{cmd|.xsessionrc|}} (depends on your distribution) so they are executed every time X starts.
 +
 
 +
To query the available options
 +
xinput list-props "TPPS/2 IBM TrackPoint"
 +
 
 +
More information can be found in the man-pages for evdev
 +
man evdev
 +
 
 +
To enable vertical scrolling
 +
xinput set-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation" 1
 +
xinput set-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation Button" 2
 +
xinput set-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation Timeout" 200
 +
 
 +
To enable horizontal scrolling in addition to vertical scrolling
 +
 
 +
xinput set-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation Axes" 6 7 4 5
 +
 
 +
To enable middle button emulation (using left- and right-click simultaneously)
 +
xinput set-prop "TPPS/2 IBM TrackPoint" "Evdev Middle Button Emulation" 1
 +
xinput set-prop "TPPS/2 IBM TrackPoint" "Evdev Middle Button Timeout" 50
 +
 
 +
== old method using xinput set-int-prop ==
 +
 
 +
Previous approaches needed to find the device's numeric id instead of simply using the name, and used "set-int-prop" instead of "set-prop", which required specifying the format (8-bit, 16-bit etc.).
 +
===Example: openSUSE 11.2 and ThinkPad USB Keyboard with TrackPoint ===
 +
 
 +
xinput list
 +
will show two "Lite-On Technology Corp. ThinkPad USB Keyboard with TrackPoint." with two different ids. Use the id with Axis 0 and Axis 1 items.
 +
 
 +
Suppose the id was 12. The following will enable the trackpoint scrolling:
 +
 
 +
xinput set-int-prop 12 "Evdev Wheel Emulation" 8 1
 +
xinput set-int-prop 12 "Evdev Wheel Emulation Button" 8 2
 +
xinput set-int-prop 12 "Evdev Wheel Emulation Timeout" 16 200
 +
 
 +
To do this in a script without knowing the numeric id in advance, the following will run through input devices and set properties on all those that support Evdev Wheel Emulation, assumed to be the Trackpoint(s).
 +
 
 +
#!/bin/sh
 +
xinput list | sed -ne 's/^[^ ][^V].*id=\([0-9]*\).*/\1/p' | while read id
 +
do
 +
        case `xinput list-props $id` in
 +
        *"Middle Button Emulation"*)
 +
                xinput set-int-prop $id "Evdev Wheel Emulation" 8 1
 +
                # etc.
 +
                ;;
 +
        esac
 +
done
 +
 
 +
and save it with any name such as trackPointScrolling.sh, and make it executable:
 +
chmod +x trackPointScrolling.sh
 +
 
 +
It can then be run via $ ./trackPointScrolling.sh or in a startup script.
 +
 
 +
= Graphical Frontends =
 +
If you are using GNOME, you might want to use [http://live.gnome.org/GPointingDeviceSettings GPointing Device Settings] or [http://tpctl.sourceforge.net/configure-trackpoint.html configure-trackpoint] as a graphical frontends.
 +
=== GPointing Device Settings ===
 +
It is available for Fedora 12, Ubuntu 9.10 and Debian Squeeze in the standard package repositories
 +
{{NOTE|Unfortunately it seems no longer maintained, and does not work properly with GNOME3 [[https://bugzilla.redhat.com/show_bug.cgi?id=710053 bug]]}}
 +
 
 +
[[image:Screenshot-GPointing Device Settings-TrackPoint.png]]
 +
 
 +
=== configure-trackpoint ===
 +
To install it in Ubuntu run ...
 +
sudo apt-get install sysfsutils
 +
...and then download and install the deb [http://sourceforge.net/projects/tpctl/ here]. Note that saved settings are not restored after reboot in Lucid Lynx. See methods below to make settings permanent.
 +
 
 +
= Configuration using DevKit =
 +
Most recent distributions like Ubuntu 9.10 switch from HAL (being deprecated) to DevKit. Hence, the HAL configurations explained underneath, fail to work.
 +
 
 +
The easiest way to configure your touchpad and trackpoint with DevKit is by using the [http://live.gnome.org/GPointingDeviceSettings GPointingDeviceSettings] panel that fully supports the hardware. You can easily download the panel by installing {{cmd| gpointing-device-settings|}}. On Ubuntu open a terminal and execute the command {{cmduser| sudo apt-get install gpointing-device-settings}}
 +
 
 +
Launch the UI through the {{cmduser| gpointing-device-settings}} command, but you can also add a menu entry to your System / Preferences menu for easier access to the UI panel.
 +
 
 +
= Configuration using udev and HAL =
 +
Modern distributions like Ubuntu 8.10 and Fedora 10 use udev and HAL to configure the input devices. You should no longer make changes to xorg.conf as by default Xorg (through the evdev driver) will let the kernel now handle input devices.
 +
 
 +
But before you get started on this you should make sure you have all the updates applied from your distro vendor as both Ubuntu 8.10 and Fedora 10 require some additional fixes that you will need.
 +
 
 +
=== Scrolling ===
 +
 
 +
By default the middle mouse button is just that, a middle mouse button, which in Linux is used for the Paste operation.
 +
 
 +
You may configure it to act in the same way as in Windows, such that you can use it for vertical scrolling: keep the button pressed and move the TrackPoint up and down to scroll. (In GPointing Device Settings, this is known as "Use wheel emulation".)
 +
 
 +
'''Note:''' This setting is not compatible with using Alt + Middle Mouse Button to resize windows. If you want to resize windows with the trackpad, disable wheel emulation. On Ubuntu 11.10, this setting resides in <tt>/usr/share/X11/xorg.conf.d/11-evdev-trackpoint.conf</tt> (see below), although some touchpads use <tt>/usr/share/X11/xorg.conf.d/50-synaptics.conf</tt>.
 +
 
 +
==== xorg.conf.d ====
 +
 
 +
Some distributions now support the new Xorg hotplug configuration method via xorg.conf.d directories (in Ubuntu 10.04 Lucid Lynx) instead of hal. In contrast to the udev method below, it should be around for some time, so it might be the best way to “statically” configure scrolling.
 +
 
 +
Create the file {{path|/usr/lib/X11/xorg.conf.d/20-thinkpad.conf}} as root with the following content:
 +
 
 +
<pre>
 +
Section "InputClass"
 +
Identifier "Trackpoint Wheel Emulation"
 +
MatchProduct "TPPS/2 IBM TrackPoint|DualPoint Stick|Synaptics Inc. Composite TouchPad / TrackPoint|ThinkPad USB Keyboard with TrackPoint|USB Trackpoint pointing device|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
 +
</pre>
 +
 
 +
Save and restart Xorg (or it'll be enabled at next reboot).
 +
 
 +
{{NOTE|For Ubuntu 10.10 Maverick Meerkat, the correct path is {{path|/usr/share/X11/xorg.conf.d}}}}
 +
{{NOTE|For Arch Linux or Fedora or PCLinuxOS, the correct path is {{path|/etc/X11/xorg.conf.d}}}}
 +
 
 +
{{NOTE|If the above does not work for you, you may need to add a different MatchProduct string.  Use <pre>find /dev/input/event* -exec udevadm info --attribute-walk --name={} \; | grep -e product -e name | sort -u</pre> to get a list of possibilities.}}
 +
 
 +
{{NOTE|If the above directory doesn't exist by default in your distribution, it probably doesn't support this method. In this case, please refer to the udev or xinput method below.}}
 +
 
 +
==== udev ====
 +
 
 +
Now that Xorg doesn't use the configuration from hal (in Debian unstable starting january 2010), the only way to “statically” configure scrolling in trackpoint is udev. (for other people, xinput method, works fine). This method will be gone (_again_) in not too long so it might be a better idea to use xinput way. YMMV.
 +
 
 +
Create the file {{path|/etc/udev/rules.d/99_trackpoint.rules}} as root with the following content:
 +
 
 +
<pre>
 +
ACTION!="add|change", GOTO="xorg_trackpoint_end"
 +
KERNEL!="event*", GOTO="xorg_trackpoint_end"
 +
 
 +
ENV{ID_PATH}!="platform-i8042-serio-1", GOTO="xorg_trackpoint_end"
 +
 
 +
ENV{x11_options.EmulateWheel}="1"
 +
ENV{x11_options.EmulateWheelButton}="2"
 +
ENV{x11_options.XAxisMapping}="6 7"
 +
ENV{x11_options.Emulate3Buttons}="0"
 +
 
 +
LABEL="xorg_trackpoint_end"
 +
</pre>
 +
 
 +
Save and restart udev then Xorg (or it'll be enabled at next reboot).
 +
 
 +
{{NOTE|The ID_PATH used in the example above is a typical value.  To determine the ID_PATH appropriate to the TrackPoint on a specific model see [[#Determining TrackPoint Path ID|Determining TrackPoint Path ID]]}}
 +
 
 +
==== Hal (soon to be deprecated) ====
 +
 
 +
To accomplish this create the file {{path|/etc/hal/fdi/policy/mouse-wheel.fdi}} as root with the following content:
 +
 
 +
<pre>
 +
<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.YAxisMapping" type="string">4 5</merge>
 +
<merge key="input.x11_options.Emulate3Buttons" type="string">true</merge>
 +
<merge key="input.x11_options.EmulateWheelTimeout" type="string">200</merge>
 +
</match>
 +
</pre>
 +
 
 +
If you also want to have horizontal scrolling, simply add the following XAxisMapping option to the above
 +
<pre>
 +
<merge key="input.x11_options.XAxisMapping" type="string">6 7</merge>
 +
</pre>
 +
After this reboot, or restart the hal service and Xorg. You can validate the settings with {{cmd|lshal|}}.
 +
 
 +
In some models (eg: X301 and X200 since Jan 10 2010 on debian sid) you may have to use "PS/2 Generic Mouse" instead of "TPPS/2 IBM TrackPoint". Have a look to your input devices typing <code>lshal|grep input.product</code>.
 +
 
 +
Alternatively it is also possible to use the "old" Xorg configuration by adding the following lines to the {{path|/etc/X11/xorg.conf}}:
 +
 
 +
<pre>
 +
Section "ServerFlags"
 +
Option "AutoAddDevices" "false"
 +
EndSection
 +
</pre>
 +
 
 +
Using this entry HAL will not be used for the input devices.
 +
 
 +
====Reactivate Scrolling after suspend/resume====
 +
Scrolling may be disabled after a resume from suspend.
 +
 
 +
You can manually reactivate the trackpoint by reloading the {{path|psmouse}} module as root:
 +
:{{cmdroot|rmmod psmouse && modprobe psmouse}}
 +
 
 +
You can automatically force the pm-utils to reload this module.
 +
Create a file {{path|/etc/pm/config.d/01reload_mouse}} as root with the following content:
 +
<pre>
 +
# reload psmouse to reactivate trackpoint scrolling
 +
SUSPEND_MODULES="${SUSPEND_MODULES:+$SUSPEND_MODULES }psmouse"
 +
</pre>
 +
 
 +
===Configuring other options (e.g. Press to select, Sensitivity and Speed)===
 +
<!--HAL wasn't made to configure sysfs settings, so we'll use udev instead -->
 +
Create a file {{path|/etc/udev/rules.d/10-trackpoint.rules}} and add a line to suit your needs
 +
 
 +
<pre>
 +
SUBSYSTEM=="serio", DRIVERS=="psmouse", ATTRS{press_to_select}="1", ATTRS{sensitivity}="122"
 +
</pre>
 +
 
 +
Testing udev  with {{cmdroot|udevadm test /sys/devices/platform/i8042/serio1}} should apply the new changes.  All of the settings listed [[How to configure the TrackPoint#Sysfs_Options_Reference|below]] can be specified here as part of a comma separated list.
 +
The customized values should be loaded automatically when booting. However, due to a [http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=549379  kernel bug] (affecting Lucid Lynx), the attributes may not yet exist when the udev rule fires. As a work around, add a WAIT_FOR condition on the attribute. In order to make sure you are using the right constraints (SUBSYSTEM, DRIVERS, etc), you can run {{cmdroot|udevadm info --query all --attribute-walk --path /sys/devices/platform/i8042/serio1/serio2}}.
 +
 
 +
<pre>
 +
SUBSYSTEM=="serio", DRIVERS=="psmouse", WAIT_FOR="/sys/devices/platform/i8042/serio1/serio2/sensitivity", ATTRS{sensitivity}="122"
 +
</pre>
 +
 
 +
On my system (Lucid Lynx), the above line did not work. I changed it to:
 +
<pre>
 +
SUBSYSTEM=="serio", DRIVERS=="psmouse", WAIT_FOR="/sys/devices/platform/i8042/serio1/serio2/sensitivity", ATTR{sensitivity}="255"
 +
</pre>
 +
and tested with {{cmdroot|udevadm test /sys/devices/platform/i8042/serio1/serio2}}.
 +
 
 +
On trusty, the following works for me:
 +
<pre>
 +
KERNEL=="serio2", SUBSYSTEM=="serio", DRIVERS=="psmouse", WAIT_FOR="/sys/devices/platform/i8042/serio1/serio2/sensitivity", ATTR{sensitivity}="255"
 +
</pre>
 +
 
 +
On xenial (16.04) the following line works for me (WAIT_FOR is not supported anymore):
 +
<pre>
 +
KERNEL=="serio2", SUBSYSTEM=="serio", DRIVERS=="psmouse", ATTR{sensitivity}:="255", ATTR{speed}:="255"
 +
</pre>
 +
 
 +
To avoid the wait you can also listen for the Trackpoint input device to appear and then run a script to set the parameters
 +
 
 +
<pre>
 +
SUBSYSTEM=="input", ATTR{name}=="*TrackPoint*", RUN+="/etc/conf.d/trackpoint"
 +
</pre>
 +
 
 +
An example {{path|/etc/conf.d/trackpoint}} would be
 +
 
 +
<pre>#! /bin/bash
 +
 
 +
## Trackpoint settings
 +
 
 +
# When run from a udev rule, DEVPATH should be set
 +
if [ ! -z $DEVPATH ] ; then
 +
    TPDEV=/sys/$( echo "$DEVPATH" | sed 's/\/input\/input[0-9]*//' )
 +
else
 +
# Otherwise just look in /sys/
 +
    TPDEV=$(find /sys/devices/platform/i8042 -name name | xargs grep -Fl TrackPoint | sed 's/\/input\/input[0-9]*\/name$//')
 +
fi
 +
 
 +
# http://www.thinkwiki.org/wiki/How_to_configure_the_TrackPoint
 +
# http://wwwcssrv.almaden.ibm.com/trackpoint/files/ykt3eext.pdf
 +
#------------------------------------------------------------
 +
if [ -d "$TPDEV" ]; then
 +
    echo "Configuring Trackpoint"
 +
    echo -n 255    > $TPDEV/sensitivity    # Integer  128  Sensitivity
 +
    echo -n 110    > $TPDEV/speed          # Integer  97  Cursor speed
 +
    echo -n 4      > $TPDEV/inertia        # Integer  6  Negative intertia
 +
else
 +
    echo "Couldn't find trackpoint device $TPDEV"
 +
fi
 +
</pre>
 +
 
 +
=Configuration using sysfs=
 +
Another way to modify changes on the fly, is echoing values directly into special files in sysfs.
 +
 
 
{{NOTE|
 
{{NOTE|
*With kernels 2.6.19 and above config files for this driver are located in <tt>/sys/devices/platform/i8042/serio1</tt>.
+
The examples shown below are valid for ThinkPads with both TrackPoint and Touchpad, in which case the sysfs path is {{path|/sys/devices/platform/i8042/serio1/serio2}}.
*With kernels 2.6.13 (inclusive) to 2.6.19 (exclusive) config files for this driver are located in <tt>/sys/devices/platform/i8042/serio0/serio2</tt>.
 
*With kernels 2.6.11 (inclusive) to 2.6.13 (exclusive) config files for this driver are located in <tt>/sys/devices/platform/i8042/serio0</tt>.
 
*With kernels 2.6.9 (inclusive) to 2.6.11 (exclusive) config files for this driver are located in <tt>/proc/trackpoint</tt>.
 
*Prior to kernel 2.6.9, configuration was not done through files but through command-line options to the psmouse module.  (Note this means you must compile psmouse as a module!)  See http://stephen.evanchik.com/node/16.
 
}}
 
|}
 
  
==General Configuration==
+
If however you have a ThinkPad without Touchpad, or with the Touchpad disabled in the BIOS, the sysfs path needs to be changed to {{path|/sys/devices/platform/i8042/serio1}} instead (notice the missing serio2 at the end).}}
The configuration options are reflected by the files you can find in {{path|/sys/devices/platform/i8042/serio0/serio2}}. See the [[Patch to enable advanced trackpoint configuration|TrackPoint driver page]] for a complete list.
 
Configuration is done by echoing the appropriate values into these special files.
 
  
 
If you want to set the sysfs parameters at boot, you can use the [http://linux-diag.sourceforge.net/Sysfsutils.html sysfsutils] and put the preferred value in /etc/sysfs.conf.
 
If you want to set the sysfs parameters at boot, you can use the [http://linux-diag.sourceforge.net/Sysfsutils.html sysfsutils] and put the preferred value in /etc/sysfs.conf.
 
==Most common Features==
 
The most common settings are '''Press to Select''', '''sensitivity''', '''speed''' and '''scrolling'''.
 
  
 
===Press to Select===
 
===Press to Select===
 
Press to Select allows you to tap the control stick which will simulate a left click. You can enable this feature by typing the following in to a terminal (you may need to be root):
 
Press to Select allows you to tap the control stick which will simulate a left click. You can enable this feature by typing the following in to a terminal (you may need to be root):
  
:{{cmdroot|echo -n 1 > /sys/devices/platform/i8042/serio0/serio2/press_to_select}}
+
:{{cmdroot|echo -n 1 > /sys/devices/platform/i8042/serio1/serio2/press_to_select}}
  
 
Press to Select should now be enabled. You can disable it in a similar manner:
 
Press to Select should now be enabled. You can disable it in a similar manner:
  
:{{cmdroot|echo -n 0 > /sys/devices/platform/i8042/serio0/serio2/press_to_select}}
+
:{{cmdroot|echo -n 0 > /sys/devices/platform/i8042/serio1/serio2/press_to_select}}
  
 
You can use this script to automate the operation
 
You can use this script to automate the operation
Line 34: Line 278:
 
         if [ "$1" = "1" ]; then
 
         if [ "$1" = "1" ]; then
 
                 echo "Turning on tap on TrackPoint"
 
                 echo "Turning on tap on TrackPoint"
                 echo -n 1 > /sys/devices/platform/i8042/serio0/serio2/press_to_select
+
                 echo -n 1 > /sys/devices/platform/i8042/serio1/serio2/press_to_select
 
                 exit 0
 
                 exit 0
 
         fi
 
         fi
 
         if [ "$1" = "0" ]; then
 
         if [ "$1" = "0" ]; then
 
                 echo "Turning off tap on TrackPoint"
 
                 echo "Turning off tap on TrackPoint"
                 echo -n 0 > /sys/devices/platform/i8042/serio0/serio2/press_to_select
+
                 echo -n 0 > /sys/devices/platform/i8042/serio1/serio2/press_to_select
 
                 exit 0
 
                 exit 0
 
         fi
 
         fi
 
         echo -n "Tap status: "
 
         echo -n "Tap status: "
         cat /sys/devices/platform/i8042/serio0/serio2/press_to_select
+
         cat /sys/devices/platform/i8042/serio1/serio2/press_to_select
 +
 
 +
In Ubuntu 8.10 to make Press to Select a permanent change:
 +
 
 +
echo -n 1 | tee /sys/devices/platform/i8042/serio1/serio2/press_to_select
 +
 
 +
As root, append the above command above "exit 0" in /etc/gdm/Init/Default
  
 
===Sensitivity & Speed===
 
===Sensitivity & Speed===
 
Adjusting the speed and sensitivity of the TrackPoint requires echoing a value between 0 and 255 into the appropriate file. For example, for a speed of 120 and a sensitivity of 250, type the following into a terminal:
 
Adjusting the speed and sensitivity of the TrackPoint requires echoing a value between 0 and 255 into the appropriate file. For example, for a speed of 120 and a sensitivity of 250, type the following into a terminal:
  
:{{cmdroot|echo -n 120 > /sys/devices/platform/i8042/serio0/serio2/speed}}
+
:{{cmdroot|echo -n 120 > /sys/devices/platform/i8042/serio1/serio2/speed}}
:{{cmdroot|echo -n 250 > /sys/devices/platform/i8042/serio0/serio2/sensitivity}}
+
:{{cmdroot|echo -n 250 > /sys/devices/platform/i8042/serio1/serio2/sensitivity}}
 +
 
 +
Alternatively, on my ThinkPad T420s, the correct commands are:
 +
 
 +
:{{cmdroot|echo -n 120 > /sys/devices/platform/i8042/serio1/speed}}
 +
:{{cmdroot|echo -n 250 > /sys/devices/platform/i8042/serio1/sensitivity}}
  
 
Feel free to experiment with your settings until you find a combination that is comfortable.
 
Feel free to experiment with your settings until you find a combination that is comfortable.
  
When you satisfy your setting , add the two lines into /etc/rc.d/rc.local in order to avoid restoring the default setting every time the system reboots.
+
When you satisfy your setting, add the two lines into /etc/rc.d/rc.local in order to avoid restoring the default setting every time the system reboots.  In Ubuntu 9.10, add the lines to /etc/rc.local to avoid this.
 +
 
 +
===Vertical Scrolling===
 +
No sysfs entry exists for vertical scrolling in kernels after 2.6.11.
  
===Scrolling===
+
The feature was removed as it was not a hardware feature, but rather emulating a scroll action in software and as such did not belong in the kernel.
====Using a kernel prior to 2.6.11====
+
Instead the scroll feature of the Xserver should be used, which can be activated with HAL or xinput as described above.
The scrolling action is essentially the same as is used in the TrackPoint Windows drivers. To enable this feature, type the following in to a terminal (you may need to be root):
 
  
:{{cmdroot|echo -n 1 > /proc/trackpoint/scroll}}
+
=Configuration using the X server (xorg.conf)=
 +
==Using the "evdev" driver (preferred, especially for recent Xorg versions)==
 +
Extract from /etc/X11/xorg.conf on an X31:
  
Then press the middle button and push the stick up and down to scroll. Similarly, to disable scrolling:
+
    Section "InputDevice"
 +
        Identifier "TPPS/2 IBM TrackPoint"
 +
        Driver    "evdev"
 +
        Option    "Device" "/dev/input/by-path/platform-i8042-serio-1-event-mouse"
 +
        Option    "GrabDevice" "False"
 +
        Option    "EmulateWheel" "true" #Enable wheel emulation for the Trackpoint
 +
        Option    "EmulateWheelButton" "2" #Use the middle button for the emulation
 +
        Option    "XAxisMapping" "6 7" #Map trackpoint X axis to X axis of emulated wheel
 +
        Option    "YAxisMapping" "4 5" #Map trackpoint Y axis to Y axis of emulated wheel
 +
    EndSection
  
:{{cmdroot|echo -n 0 > /proc/trackpoint/scroll}}
+
{{NOTE|The device path used in the example above is a typical value.  To determine the device path appropriate to the TrackPoint on a specific model see [[#Determining TrackPoint Path ID|Determining TrackPoint Path ID]]}}
  
====Using the X server (kernel 2.6.11+)====
+
==Using the "mouse" driver (deprecated, only for old Xorg versions)==
 +
{{NOTE|This only applies to old distributions with Xorg versions that did not yet use evdev. For modern distributions use one of the other methods}}
 
The scroll setting has been removed from the trackpoint driver in kernel versions 2.6.11 and above. Scroll emulation should now be handled in the X server.
 
The scroll setting has been removed from the trackpoint driver in kernel versions 2.6.11 and above. Scroll emulation should now be handled in the X server.
  
Line 116: Line 385:
 
to the synaptics device section. This will make the synaptics driver ignore the Trackpoint, so it will be handled by the mouse driver. This allowed me to disable the touchpad while making the TrackPoint work like it should.
 
to the synaptics device section. This will make the synaptics driver ignore the Trackpoint, so it will be handled by the mouse driver. This allowed me to disable the touchpad while making the TrackPoint work like it should.
  
{{NOTE| With the above mouse section in my xorg.conf all this works like a charm:  
+
{{NOTE| With the above mouse section in my xorg.conf all this works like a charm:
 
*I can press the wheel on my external USB mouse and move the mouse up and down for scrolling
 
*I can press the wheel on my external USB mouse and move the mouse up and down for scrolling
 
*or I can just use the wheel on the external mouse for scrolling
 
*or I can just use the wheel on the external mouse for scrolling
Line 122: Line 391:
 
*Even horizontal scrolling works automagically in Konqueror, for Firefox/Opera see below.
 
*Even horizontal scrolling works automagically in Konqueror, for Firefox/Opera see below.
  
Simultaneously I can use  
+
Simultaneously I can use
*a press on the external mouse's wheel  
+
*a press on the external mouse's wheel
 
*or the MMB of the trackpoint
 
*or the MMB of the trackpoint
  
Line 130: Line 399:
 
{{HINT| If you don't use the middle-mouse-button for pasting and sometimes pasting things by mistake while scrolling (witch is really odd) simply set the "EmulateWheelTimeOut" to "1" as a (bloody) workaround. Middle click will only possible with pressing left and right button simultaneously!}}
 
{{HINT| If you don't use the middle-mouse-button for pasting and sometimes pasting things by mistake while scrolling (witch is really odd) simply set the "EmulateWheelTimeOut" to "1" as a (bloody) workaround. Middle click will only possible with pressing left and right button simultaneously!}}
  
 
+
=Application specific tweaks=
===== EmulateWheelTimeout temporarily broken (-> fix for Ubuntu Dapper) =====  
+
===Configure Opera for using trackpoint horizontal scrolling===
 
+
To fix horizontal scrolling in Opera, you need to edit the configfile <tt>standard_mouse.ini</tt> in e.g. /usr/share/opera/ui/ (Debian) or /opt/opera/share/opera/ini/ (Gentoo) and comment out the following lines
Unfortunately, there was a regression so that EmulateWheelTimeout was broken in X.org 6.9.0, and fixed
 
on March 20th, 2006.
 
You can see the [https://bugs.freedesktop.org/show_bug.cgi?id=5071 primary bug report] here, and also reports on the [http://qa.mandriva.com/show_bug.cgi?id=21196 Mandriva] and [http://lists.debian.org/debian-x/2006/01/msg00249.html Debian] ([http://bugs.debian.org/346098 #346098], [http://bugs.debian.org/320136 #320136]) packages.
 
 
 
Unfortunately, this bug is still present in Ubuntu Dapper Drake's xserver-xorg-input-mouse package (version 1.0.3.1+cvs.20060109-0ubuntu1)!
 
 
 
{{HINT|xserver-xorg-input-mouse (version 1.0.3.1+cvs.20060109-0ubuntu1.1) is in dapper-updates since July 3rd, 2006. You don't need to patch it anymore.}}
 
 
 
Use the following procedure to make it (middle button scrolling & middle button pasting) work:
 
 
 
:{{cmduser|cd /desired/path && mkdir tmp && cd tmp}} (create temporary directory somewhere)
 
:{{cmduser|sudo nano /etc/apt/sources.list}} (insert/uncomment the deb-src lines, save and exit)
 
:{{cmduser|sudo apt-get update}}
 
:{{cmduser|apt-get source xserver-xorg-input-mice}} (in order to get the source code)
 
:{{cmduser|sudo aptitude install xserver-xorg-dev}} (this package and the packages it depends on are needed in order to compile the source code, use aptitude for easy removal later on)
 
:{{cmduser|cd xserver-xorg-input-mouse-1.0.3.1+cvs.20060109/}}
 
:{{cmduser|wget http://librarian.launchpad.net/2639933/xserver-xorg-input-mouse_1.0.3.1+cvs.20060109-0ubuntu2.debdiff}} (downloads the patch that fixes the bug)
 
:{{cmduser|patch -p1 < xserver-xorg-input-mouse_1.0.3.1+cvs.20060109-0ubuntu2.debdiff}} (applies the bug fix)
 
:{{cmduser|fakeroot dpkg-buildpackage}} (rebuilds the package... watch out for errors and install other missing packages)
 
:{{cmduser|sudo dpkg -i ../xserver-xorg-input-mouse_1.0.3.1+cvs.20060109-0ubuntu2_i386.deb}} (installs the rebuilt built package)
 
:{{cmduser|sudo aptitude remove xserver-xorg-dev}} (removes the packages needed to rebuild the package)
 
 
 
Hope it works for you, it did work for me!
 
CrypTom
 
 
 
===== Older versions of X.org =====
 
 
 
For older versions of Xorg or for Xfree86 ({{path|/etc/X11/XF86Config}}) try this:
 
 
 
      Option          "Emulate3Buttons"      "true"
 
      Option          "EmulateWheel"          "true"
 
      Option          "EmulateWheelButton"    "2"
 
 
 
Now restart X and hold down button two and move the mouse for scrolling. To get a middle click, press buttons 1 and 3 simultaneously.
 
 
 
==Soft Transparent Mode==
 
If you wish to connect a special device to the external PS/2 port, you should consider using "Soft Transparent Mode" so that the TrackPoint controller does not interpret any commands sent to the external PS/2 port. You can enable soft transparent mode by typing the following in to a terminal:
 
 
 
:{{cmdroot|echo -n 1 > /sys/devices/platform/i8042/serio0/serio2/transparent}}
 
 
 
Disabling soft transparent mode is similar:
 
 
 
:{{cmdroot|echo -n 0 > /sys/devices/platform/i8042/serio0/serio2/transparent}}
 
 
 
==Modify trackpoint parameter permanently in trackpoint.h==
 
If you do not want to run a script to reconfigure the trackpoint
 
you can change the default settings in the trackpoint header file that is located in
 
/usr/src/<KERNEL_VERSION>/drivers/input/mouse/trackpoint.h.
 
 
 
First you must convert the values (decimal numbers) you normaly echo to /sys/[...] to hex:
 
 
 
'''echo -e 'obase=16;<DECIMAL_NUMBER>' | bc'''
 
 
 
Then simply replace the default hex values in trackpoint.h, run 'make && make modules_install' to recompile and install psmouse.ko (should be compiled as module)
 
 
 
 
 
Example patch (speed=100, sensitivity=190, press_to_select=1):
 
<pre>
 
--- trackpoint.h.orig  2006-01-17 16:18:30.000000000 +0100
 
+++ trackpoint.h        2006-01-17 16:25:47.000000000 +0100
 
@@ -108,9 +108,9 @@
 
/*
 
  * Default power on values
 
  */
 
-#define TP_DEF_SENS            0x80
 
+#define TP_DEF_SENS            0xBE
 
#define TP_DEF_INERTIA        0x06
 
-#define TP_DEF_SPEED          0x61
 
+#define TP_DEF_SPEED          0x64
 
#define TP_DEF_REACH          0x0A
 
 
 
#define TP_DEF_DRAGHYS        0xFF
 
@@ -123,7 +123,7 @@
 
 
 
/* Toggles */
 
#define TP_DEF_MB              0x00
 
-#define TP_DEF_PTSON          0x00
 
+#define TP_DEF_PTSON          0x01
 
#define TP_DEF_SKIPBACK                0x00
 
#define TP_DEF_EXT_DEV        0x01
 
</pre>
 
 
 
==Configure firefox for using trackpoint horizontal scrolling==
 
Vertical Scrolling seems to work out of the box in firefox if you followed the steps above.
 
Anyway, there is a problem when you don't scroll exactly vertical, because horizontal scrolling turns into
 
browser BACK/FORWARD commands.
 
You can avoid this by typing about:config + ENTER in the address bar of firefox.
 
You have to adjust the following options:
 
 
 
<pre>
 
mousewheel.horizscroll.withcontrolkey.action = 3;
 
mousewheel.horizscroll.withcontrolkey.numlines = 1;
 
mousewheel.horizscroll.withcontrolkey.sysnumlines = true;
 
 
 
mousewheel.horizscroll.withnokey.action = 0;
 
mousewheel.horizscroll.withnokey.numlines = 1;
 
mousewheel.horizscroll.withnokey.sysnumlines = true;
 
 
 
mousewheel.horizscroll.withshiftkey.action = 1;
 
mousewheel.horizscroll.withshiftkey.numlines = 1;
 
mousewheel.horizscroll.withshiftkey.sysnumlines = true;
 
</pre>
 
 
 
FWIW, you can change only the following value to remove the browser BACK/FORWARD commands:
 
 
 
<pre>
 
mousewheel.horizscroll.withnokey.action = 0;
 
</pre>
 
 
 
With that, you can still go BACK/FORWARD by pressing together the shift or the alt key, while with the control key you increase or decrease the font size.
 
 
 
==Configure Opera for using trackpoint horizontal scrolling==
 
You'll experience the same annoying problem with the popular browser Opera. To fix this you need to edit the configfile <tt>standard_mouse.ini</tt> in e.g. /usr/share/opera/ini/ (Debian) or /opt/opera/share/opera/ini/ (Gentoo) and comment out the following lines
 
 
<pre>
 
<pre>
 
Button6                                                        = Back
 
Button6                                                        = Back
Line 261: Line 417:
 
After this change you will be able to scroll vertically and horizontally with your middle button.
 
After this change you will be able to scroll vertically and horizontally with your middle button.
  
==Fixing trackpoint under Ubuntu 7.10 Gutsy Gibbon==
+
===Firefox 3 tweaks===
===Using trackpoint deamon===
+
These settings make Firefox on Linux behave more like the Windows version. They were tested on an out of the box Fedora 10 system on a Thinkpad T61. Go into about:config, and set the following:
My default Ubuntu Gutsy (running on an X61s) would give the following error messages when running the trackpoint daemon. Running
 
<pre>
 
    /etc/init.d/trackpoint restart
 
</pre>
 
caused a bunch of error messages, as the wrong device was in
 
<pre>
 
        /etc/trackpoint/trackpoint.conf
 
</pre>
 
  
I fixed this by changing:
+
middlemouse.paste = false
<pre>
+
  middlemouse.contentLoadURL = false
        echo -n > /sys/devices/platform/i8042/serio0/serio2/sensitivity
+
  general.autoScroll = true
</pre>
 
to
 
<pre>
 
        echo -n > /sys/devices/platform/i8042/serio1/sensitivity
 
</pre>
 
in /etc/trackpoint/trackpoint.conf.
 
  
In addition, Ubuntu ran the appropriate /etc/init.d/trackpoint script on booting, but would give a bunch of errors (which, oddly, I could never find in any of the log files).
+
=Sysfs Options Reference=
 
+
{{NOTE|These options are current as of kernel version 2.6.29, 3 May 2009}}
It seems that it was running the scripts too early in the boot sequence. The Gutsy package provided
+
{|
<pre>
+
|-
    /etc/rc2.d/S20trackpoint
+
! Name
</pre>
+
! Type
 
+
! Default
so I renamed this to S99trackpoint (and in all the other rc.? directories) and it now works on boot.
+
! Notes
 
+
|-
===Editing the kernel config files===
+
| sensitivity
Another way of configuring the trackpoint without using the trackpoint daemon is to edit the values of the trackpoint files which, BTW, are located in
+
| Integer
/sys/devices/platform/i8042/serio1/serio2.
+
| 128
 
+
| Sensitivity
The script should be executed during boot. This can be done in an init script (e.g. /etc/bootmisc.sh in some distros)
+
|-
 
+
| speed
Script:
+
| Integer
<pre>
+
| 97
#! /bin/sh
+
| Cursor speed
 
+
|-
#
+
| inertia
# configuration du trackpoint
+
| Integer
#
+
| 6
 
+
| Described as "negative inertia."  It acts more like friction.  High values cause the cursor to snap backward when the Trackpoint is released
# vitesse
+
|-
echo -n 120 > /sys/devices/platform/i8042/serio1/serio2/speed
+
| reach
 
+
| Integer
# sensibilité
+
| 10
echo -n 250 > /sys/devices/platform/i8042/serio1/serio2/sensitivity
+
| Backup for Z-axis press
 
+
|-
# press to select
+
| draghys
echo -n 1 > /sys/devices/platform/i8042/serio1/serio2/press_to_select
+
| Integer
</pre>
+
| 255
===An Ubuntu/Fedora example===
+
| Drag hysteresis (how hard it is to drag with Z-axis pressed)
Another script that I've created seems to work with all versions of Ubuntu/Fedora that I've been able to try (comment out and uncomment the appropriate lines for fedora/ubuntu as necessary)
+
|-
Place in /etc/rc.local or equivalent for your distro:
+
| mindrag
 
+
| Integer
Script:
+
| 20
<pre>
+
| Minimum amount of force needed to trigger dragging
#*************************
+
|-
## START TRACKPOINT CONFIG
+
| thresh
#*************************
+
| Integer
 
+
| 8
# For fedora (the slash after "speed" is returned)
+
| Minimum value for a Z-axis press
# TRACKPATH=$(find /sys -print0 | grep -FzZ "/serio2/speed" | sed s^speed/^^)
+
|-
 
+
| upthresh
# For ubuntu (the slash after "speed" is not returned)
+
| Integer
TRACKPATH=$(find /sys -print0 | grep -FzZ "/serio2/speed" | sed s/speed//)
+
| 255
 
+
| Used to generate a 'click' on Z-axis
## Select "press_to_select" on the trackpoint input device
+
|-
## We need to specify the TRACKPATH above because the device under "serio#"
+
| ztime
## changes between system boots. (We first test to see if the file we want
+
| Integer
## to modify exists, if it does, we make the change
+
| 38
#[ -f $TRACKPATH/press_to_select ] && echo -n 1 > $TRACKPATH/press_to_select
+
| How sharp of a press
 
+
|-
## Adjust the speed setting of the trackpoint input device
+
| jenks
[ -f $TRACKPATH/speed ] && echo -n 120 > $TRACKPATH/speed
+
| Integer
## Adjust the sensitivity setting of the trackpoint input device
+
| 135
[ -f $TRACKPATH/sensitivity ] && echo -n 200 > $TRACKPATH/sensitivity
+
| Minimum curvature for double click
 
+
|-
#***********************
+
| press_to_select
## END TRACKPOINT CONFIG
+
| Boolean
#***********************
+
| 0
</pre>
+
| Press to select
 
+
|-
==TrackPoint under Ubuntu 8.10 using HAL==
+
| skipback
 
+
| Boolean
Because Ubuntu 8.10 uses HAL you must do the following to get the scrolling working:
+
| 0
(see: http://forum.ubuntuusers.de/topic/mouse-wheel-emulation-in-xorg.conf/?highlight=hal+trackpoint#post-1558282 )
+
| Supress movement after drag release
 
+
|-
Create the file '''/etc/hal/fdi/policy/mouse-wheel.fdi''' as root with the following content:
+
| ext_dev
 
+
| Boolean
<pre>
+
| 0
<match key="info.product" string="TPPS/2 IBM TrackPoint">
+
| Disable external device
<merge key="input.x11_options.EmulateWheel" type="string">true</merge>
+
|}
  <merge key="input.x11_options.EmulateWheelButton" type="string">2</merge>
+
Table info taken from [http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=drivers/input/mouse/trackpoint.h;hb=HEAD here]The given link will always point to the current version of the driver. If the notes seem sparse, that's because the code is sparse. On the other hand, the [http://wwwcssrv.almaden.ibm.com/trackpoint/files/ykt3eext.pdf Trackpoint Engineering Specification Version 4.0] <!--if this link breaks, I recommend a quick Google search for "trackpoint version 4 engineering specifications" --> contains more documentation information than anyone ever desired.
<merge key="input.x11_options.YAxisMapping" type="string">4 5</merge>
 
<merge key="input.x11_options.XAxisMapping" type="string">6 7</merge>
 
<merge key="input.x11_options.Emulate3Buttons" type="string">true</merge>
 
<merge key="input.x11_options.EmulateWheelTimeout" type="string">200</merge>
 
</match>
 
</pre>
 
 
 
Note : I needed to reboot my TP for the changes to take effect.
 
  
https://wiki.ubuntu.com/X/Config
+
=Determining TrackPoint Path ID=
 +
Both the [[#udev|udev]] and [[#Configuration using the X server (xorg.conf)|xorg.conf]] configuration methods require knowledge of the Path ID of the TrackPoint.  In the [[#udev|udev]] configuration method, the Path ID is used to match the ID_PATH environmental variable, in the [[#Configuration using the X server (xorg.conf)|xorg.conf]] configuration method it is the prefix for the device file name inside the {{path|/dev/input/by-id}} directory.  The path ID can vary between ThinkPad models, distributions (with varying kernel patches), and between kernel versions.  One way to find the path ID for the TrackPoint is to use udev's path_id utility on the sysfs device path for the TrackPoint.  This device path can be found using the {{path|name}} file which describes the TrackPoint.  The process can be automated using the following shell command:
 +
/lib/udev/path_id $(find /sys/devices/platform/i8042 -name name | xargs grep -Fl TrackPoint | sed 's/\/sys\(.*\)\/name/\1/')

Latest revision as of 02:59, 11 May 2017

Below are several ways of configuring the kernel psmouse driver for controlling extended TrackPoint features.

On a Modern distribution (like Fedora, Ubuntu or OpenSUSE) you will want to use xinput or one of the graphical front ends. For distributions that are lagging a bit (e.g. Debian Lenny and PCLOS '09) you may still want to use the old xorg config method.

Configuration using xinput

If you want to modify changes on the fly, you can do so with xinput (part of the optional xorg-x11-apps rpm on Fedora). Note that these changes are not saved when the xserver is restarted. However, you can add the lines e.g. in your .xsessionrc (depends on your distribution) so they are executed every time X starts.

To query the available options

xinput list-props "TPPS/2 IBM TrackPoint"

More information can be found in the man-pages for evdev

man evdev

To enable vertical scrolling

xinput set-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation" 1
xinput set-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation Button" 2
xinput set-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation Timeout" 200

To enable horizontal scrolling in addition to vertical scrolling

xinput set-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation Axes" 6 7 4 5

To enable middle button emulation (using left- and right-click simultaneously)

xinput set-prop "TPPS/2 IBM TrackPoint" "Evdev Middle Button Emulation" 1
xinput set-prop "TPPS/2 IBM TrackPoint" "Evdev Middle Button Timeout" 50

old method using xinput set-int-prop

Previous approaches needed to find the device's numeric id instead of simply using the name, and used "set-int-prop" instead of "set-prop", which required specifying the format (8-bit, 16-bit etc.).

Example: openSUSE 11.2 and ThinkPad USB Keyboard with TrackPoint

xinput list

will show two "Lite-On Technology Corp. ThinkPad USB Keyboard with TrackPoint." with two different ids. Use the id with Axis 0 and Axis 1 items.

Suppose the id was 12. The following will enable the trackpoint scrolling:

xinput set-int-prop 12 "Evdev Wheel Emulation" 8 1
xinput set-int-prop 12 "Evdev Wheel Emulation Button" 8 2
xinput set-int-prop 12 "Evdev Wheel Emulation Timeout" 16 200

To do this in a script without knowing the numeric id in advance, the following will run through input devices and set properties on all those that support Evdev Wheel Emulation, assumed to be the Trackpoint(s).

#!/bin/sh
xinput list | sed -ne 's/^[^ ][^V].*id=\([0-9]*\).*/\1/p' | while read id
do
        case `xinput list-props $id` in
        *"Middle Button Emulation"*)
                xinput set-int-prop $id "Evdev Wheel Emulation" 8 1
                # etc.
                ;;
        esac
done

and save it with any name such as trackPointScrolling.sh, and make it executable:

chmod +x trackPointScrolling.sh

It can then be run via $ ./trackPointScrolling.sh or in a startup script.

Graphical Frontends

If you are using GNOME, you might want to use GPointing Device Settings or configure-trackpoint as a graphical frontends.

GPointing Device Settings

It is available for Fedora 12, Ubuntu 9.10 and Debian Squeeze in the standard package repositories

NOTE!
Unfortunately it seems no longer maintained, and does not work properly with GNOME3 [bug]

Screenshot-GPointing Device Settings-TrackPoint.png

configure-trackpoint

To install it in Ubuntu run ...

sudo apt-get install sysfsutils

...and then download and install the deb here. Note that saved settings are not restored after reboot in Lucid Lynx. See methods below to make settings permanent.

Configuration using DevKit

Most recent distributions like Ubuntu 9.10 switch from HAL (being deprecated) to DevKit. Hence, the HAL configurations explained underneath, fail to work.

The easiest way to configure your touchpad and trackpoint with DevKit is by using the GPointingDeviceSettings panel that fully supports the hardware. You can easily download the panel by installing gpointing-device-settings. On Ubuntu open a terminal and execute the command $ sudo apt-get install gpointing-device-settings

Launch the UI through the $ gpointing-device-settings command, but you can also add a menu entry to your System / Preferences menu for easier access to the UI panel.

Configuration using udev and HAL

Modern distributions like Ubuntu 8.10 and Fedora 10 use udev and HAL to configure the input devices. You should no longer make changes to xorg.conf as by default Xorg (through the evdev driver) will let the kernel now handle input devices.

But before you get started on this you should make sure you have all the updates applied from your distro vendor as both Ubuntu 8.10 and Fedora 10 require some additional fixes that you will need.

Scrolling

By default the middle mouse button is just that, a middle mouse button, which in Linux is used for the Paste operation.

You may configure it to act in the same way as in Windows, such that you can use it for vertical scrolling: keep the button pressed and move the TrackPoint up and down to scroll. (In GPointing Device Settings, this is known as "Use wheel emulation".)

Note: This setting is not compatible with using Alt + Middle Mouse Button to resize windows. If you want to resize windows with the trackpad, disable wheel emulation. On Ubuntu 11.10, this setting resides in /usr/share/X11/xorg.conf.d/11-evdev-trackpoint.conf (see below), although some touchpads use /usr/share/X11/xorg.conf.d/50-synaptics.conf.

xorg.conf.d

Some distributions now support the new Xorg hotplug configuration method via xorg.conf.d directories (in Ubuntu 10.04 Lucid Lynx) instead of hal. In contrast to the udev method below, it should be around for some time, so it might be the best way to “statically” configure scrolling.

Create the file /usr/lib/X11/xorg.conf.d/20-thinkpad.conf as root with the following content:

Section "InputClass"
	Identifier	"Trackpoint Wheel Emulation"
	MatchProduct	"TPPS/2 IBM TrackPoint|DualPoint Stick|Synaptics Inc. Composite TouchPad / TrackPoint|ThinkPad USB Keyboard with TrackPoint|USB Trackpoint pointing device|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

Save and restart Xorg (or it'll be enabled at next reboot).

NOTE!
For Ubuntu 10.10 Maverick Meerkat, the correct path is /usr/share/X11/xorg.conf.d
NOTE!
For Arch Linux or Fedora or PCLinuxOS, the correct path is /etc/X11/xorg.conf.d
NOTE!
If the above does not work for you, you may need to add a different MatchProduct string. Use
find /dev/input/event* -exec udevadm info --attribute-walk --name={} \; | grep -e product -e name | sort -u
to get a list of possibilities.
NOTE!
If the above directory doesn't exist by default in your distribution, it probably doesn't support this method. In this case, please refer to the udev or xinput method below.

udev

Now that Xorg doesn't use the configuration from hal (in Debian unstable starting january 2010), the only way to “statically” configure scrolling in trackpoint is udev. (for other people, xinput method, works fine). This method will be gone (_again_) in not too long so it might be a better idea to use xinput way. YMMV.

Create the file /etc/udev/rules.d/99_trackpoint.rules as root with the following content:

ACTION!="add|change", GOTO="xorg_trackpoint_end"
KERNEL!="event*", GOTO="xorg_trackpoint_end"

ENV{ID_PATH}!="platform-i8042-serio-1", GOTO="xorg_trackpoint_end"

ENV{x11_options.EmulateWheel}="1"
ENV{x11_options.EmulateWheelButton}="2"
ENV{x11_options.XAxisMapping}="6 7"
ENV{x11_options.Emulate3Buttons}="0"

LABEL="xorg_trackpoint_end"

Save and restart udev then Xorg (or it'll be enabled at next reboot).

NOTE!
The ID_PATH used in the example above is a typical value. To determine the ID_PATH appropriate to the TrackPoint on a specific model see Determining TrackPoint Path ID

Hal (soon to be deprecated)

To accomplish this create the file /etc/hal/fdi/policy/mouse-wheel.fdi as root with the following content:

<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.YAxisMapping" type="string">4 5</merge>
 <merge key="input.x11_options.Emulate3Buttons" type="string">true</merge>
 <merge key="input.x11_options.EmulateWheelTimeout" type="string">200</merge>
</match>

If you also want to have horizontal scrolling, simply add the following XAxisMapping option to the above

 <merge key="input.x11_options.XAxisMapping" type="string">6 7</merge>

After this reboot, or restart the hal service and Xorg. You can validate the settings with lshal.

In some models (eg: X301 and X200 since Jan 10 2010 on debian sid) you may have to use "PS/2 Generic Mouse" instead of "TPPS/2 IBM TrackPoint". Have a look to your input devices typing lshal|grep input.product.

Alternatively it is also possible to use the "old" Xorg configuration by adding the following lines to the /etc/X11/xorg.conf:

Section "ServerFlags"
	Option 	"AutoAddDevices" "false"
EndSection

Using this entry HAL will not be used for the input devices.

Reactivate Scrolling after suspend/resume

Scrolling may be disabled after a resume from suspend.

You can manually reactivate the trackpoint by reloading the psmouse module as root:

# rmmod psmouse && modprobe psmouse

You can automatically force the pm-utils to reload this module. Create a file /etc/pm/config.d/01reload_mouse as root with the following content:

# reload psmouse to reactivate trackpoint scrolling
SUSPEND_MODULES="${SUSPEND_MODULES:+$SUSPEND_MODULES }psmouse"

Configuring other options (e.g. Press to select, Sensitivity and Speed)

Create a file /etc/udev/rules.d/10-trackpoint.rules and add a line to suit your needs

SUBSYSTEM=="serio", DRIVERS=="psmouse", ATTRS{press_to_select}="1", ATTRS{sensitivity}="122"

Testing udev with # udevadm test /sys/devices/platform/i8042/serio1 should apply the new changes. All of the settings listed below can be specified here as part of a comma separated list. The customized values should be loaded automatically when booting. However, due to a kernel bug (affecting Lucid Lynx), the attributes may not yet exist when the udev rule fires. As a work around, add a WAIT_FOR condition on the attribute. In order to make sure you are using the right constraints (SUBSYSTEM, DRIVERS, etc), you can run # udevadm info --query all --attribute-walk --path /sys/devices/platform/i8042/serio1/serio2.

SUBSYSTEM=="serio", DRIVERS=="psmouse", WAIT_FOR="/sys/devices/platform/i8042/serio1/serio2/sensitivity", ATTRS{sensitivity}="122"

On my system (Lucid Lynx), the above line did not work. I changed it to:

SUBSYSTEM=="serio", DRIVERS=="psmouse", WAIT_FOR="/sys/devices/platform/i8042/serio1/serio2/sensitivity", ATTR{sensitivity}="255"

and tested with # udevadm test /sys/devices/platform/i8042/serio1/serio2.

On trusty, the following works for me:

KERNEL=="serio2", SUBSYSTEM=="serio", DRIVERS=="psmouse", WAIT_FOR="/sys/devices/platform/i8042/serio1/serio2/sensitivity", ATTR{sensitivity}="255"

On xenial (16.04) the following line works for me (WAIT_FOR is not supported anymore):

KERNEL=="serio2", SUBSYSTEM=="serio", DRIVERS=="psmouse", ATTR{sensitivity}:="255", ATTR{speed}:="255"

To avoid the wait you can also listen for the Trackpoint input device to appear and then run a script to set the parameters

SUBSYSTEM=="input", ATTR{name}=="*TrackPoint*", RUN+="/etc/conf.d/trackpoint"

An example /etc/conf.d/trackpoint would be

#! /bin/bash

## Trackpoint settings

# When run from a udev rule, DEVPATH should be set
if [ ! -z $DEVPATH ] ; then
    TPDEV=/sys/$( echo "$DEVPATH" | sed 's/\/input\/input[0-9]*//' )
else
# Otherwise just look in /sys/
    TPDEV=$(find /sys/devices/platform/i8042 -name name | xargs grep -Fl TrackPoint | sed 's/\/input\/input[0-9]*\/name$//')
fi

# http://www.thinkwiki.org/wiki/How_to_configure_the_TrackPoint
# http://wwwcssrv.almaden.ibm.com/trackpoint/files/ykt3eext.pdf
#------------------------------------------------------------
if [ -d "$TPDEV" ]; then
    echo "Configuring Trackpoint"
    echo -n 255     > $TPDEV/sensitivity     # Integer  128   Sensitivity
    echo -n 110     > $TPDEV/speed           # Integer  97   Cursor speed
    echo -n 4       > $TPDEV/inertia         # Integer  6   Negative intertia
else
    echo "Couldn't find trackpoint device $TPDEV"
fi

Configuration using sysfs

Another way to modify changes on the fly, is echoing values directly into special files in sysfs.

NOTE!

The examples shown below are valid for ThinkPads with both TrackPoint and Touchpad, in which case the sysfs path is /sys/devices/platform/i8042/serio1/serio2.

If however you have a ThinkPad without Touchpad, or with the Touchpad disabled in the BIOS, the sysfs path needs to be changed to /sys/devices/platform/i8042/serio1 instead (notice the missing serio2 at the end).

If you want to set the sysfs parameters at boot, you can use the sysfsutils and put the preferred value in /etc/sysfs.conf.

Press to Select

Press to Select allows you to tap the control stick which will simulate a left click. You can enable this feature by typing the following in to a terminal (you may need to be root):

# echo -n 1 > /sys/devices/platform/i8042/serio1/serio2/press_to_select

Press to Select should now be enabled. You can disable it in a similar manner:

# echo -n 0 > /sys/devices/platform/i8042/serio1/serio2/press_to_select

You can use this script to automate the operation

       #!/bin/bash
       if [ "$1" = "1" ]; then
               echo "Turning on tap on TrackPoint"
               echo -n 1 > /sys/devices/platform/i8042/serio1/serio2/press_to_select
               exit 0
       fi
       if [ "$1" = "0" ]; then
               echo "Turning off tap on TrackPoint"
               echo -n 0 > /sys/devices/platform/i8042/serio1/serio2/press_to_select
               exit 0
       fi
       echo -n "Tap status: "
       cat /sys/devices/platform/i8042/serio1/serio2/press_to_select

In Ubuntu 8.10 to make Press to Select a permanent change:

echo -n 1 | tee /sys/devices/platform/i8042/serio1/serio2/press_to_select

As root, append the above command above "exit 0" in /etc/gdm/Init/Default

Sensitivity & Speed

Adjusting the speed and sensitivity of the TrackPoint requires echoing a value between 0 and 255 into the appropriate file. For example, for a speed of 120 and a sensitivity of 250, type the following into a terminal:

# echo -n 120 > /sys/devices/platform/i8042/serio1/serio2/speed
# echo -n 250 > /sys/devices/platform/i8042/serio1/serio2/sensitivity

Alternatively, on my ThinkPad T420s, the correct commands are:

# echo -n 120 > /sys/devices/platform/i8042/serio1/speed
# echo -n 250 > /sys/devices/platform/i8042/serio1/sensitivity

Feel free to experiment with your settings until you find a combination that is comfortable.

When you satisfy your setting, add the two lines into /etc/rc.d/rc.local in order to avoid restoring the default setting every time the system reboots. In Ubuntu 9.10, add the lines to /etc/rc.local to avoid this.

Vertical Scrolling

No sysfs entry exists for vertical scrolling in kernels after 2.6.11.

The feature was removed as it was not a hardware feature, but rather emulating a scroll action in software and as such did not belong in the kernel. Instead the scroll feature of the Xserver should be used, which can be activated with HAL or xinput as described above.

Configuration using the X server (xorg.conf)

Using the "evdev" driver (preferred, especially for recent Xorg versions)

Extract from /etc/X11/xorg.conf on an X31:

   Section "InputDevice"
       Identifier "TPPS/2 IBM TrackPoint"
       Driver     "evdev"
       Option     "Device" "/dev/input/by-path/platform-i8042-serio-1-event-mouse"
       Option     "GrabDevice" "False"
       Option     "EmulateWheel" "true" #Enable wheel emulation for the Trackpoint
       Option     "EmulateWheelButton" "2" #Use the middle button for the emulation
       Option     "XAxisMapping" "6 7" #Map trackpoint X axis to X axis of emulated wheel
       Option     "YAxisMapping" "4 5" #Map trackpoint Y axis to Y axis of emulated wheel
   EndSection
NOTE!
The device path used in the example above is a typical value. To determine the device path appropriate to the TrackPoint on a specific model see Determining TrackPoint Path ID

Using the "mouse" driver (deprecated, only for old Xorg versions)

NOTE!
This only applies to old distributions with Xorg versions that did not yet use evdev. For modern distributions use one of the other methods

The scroll setting has been removed from the trackpoint driver in kernel versions 2.6.11 and above. Scroll emulation should now be handled in the X server.

A nice side effect of that is, that middle button scrolling applies to any mouse and not just the TrackPoint interface, which can be a quite handy feature for desktop computers or people who prefer to use an external mouse, especially when scrolling through long lists or needing to use horizontal scrolling with a mouse which has only a vertical scroll wheel.

The necessary functionality, known as "EmulateWheelTimeout" allowing to use button 2 for a middle click, wasn't implemented in Xorg prior to 6.9/7.0. However, there was a patch included in most distributions packages of Xorg, which was announced here. You can find an updated version of the package in the experimental branch of Debian or try to build the mouse driver yourself with the information in the announcement. This has successfully been tried with FC3's 6.8.2 packages.

Once this functionality is in the X.org, add these lines to your TrackPoint configuration section in /etc/X11/xorg.conf:

       Option          "EmulateWheel"          "on"
       Option          "EmulateWheelButton"    "2"

It may also be necessary to add these lines:

       Option "YAxisMapping" "4 5"
       Option "XAxisMapping" "6 7"

which specify which buttons are mapped to motion in the vertical (Y) and horizontal (X) directions, respectively, in wheel emulation mode (see http://www.xfree86.org/current/mouse.4.html).

Hint:
Use the program "xev" to see, what mouse button identifiers are sent by your mouse/touchpad/trackpoint.
You might want to try: "xev | grep button"
Hint:
If it does not work see if evdev is installed and remove it. On gentoo do the following:

eix xf86-input-evdev
emerge -C xf86-input-evdev
and then remove the evdev flag in make.conf INPUT_DEVICES

So, a complete mouse section, that implements this nicely and works very well on my R51, even with a simultaneously connected USB mouse, looks like that (tried out today, 20th of September, 2006 on Dapper):

 Section "InputDevice"
       Identifier  "Configured Mouse"
       Driver      "mouse"
       Option      "CorePointer"
       Option      "Device"              "/dev/input/mice"
       Option      "Protocol"            "ExplorerPS/2"
       Option      "Emulate3Buttons"     "on"
       Option      "Emulate3TimeOut"     "50"
       Option      "EmulateWheel"        "on"
       Option      "EmulateWheelTimeOut" "200"
       Option      "EmulateWheelButton"  "2"
       Option      "YAxisMapping"        "4 5"
       Option      "XAxisMapping"        "6 7"
       Option      "ZAxisMapping"        "4 5"
 EndSection

The mappings for Y and Z are the same, since the "Z-Axis" refers to actual hardware scrolling wheels which usually scroll the screen along the Y-Axis. If there is no hardware scrolling wheel present, horizontal and vertical scrolling using the TrackPoint work fine without the Z-Axis line.

Now restart X and hold down button 2 and move the mouse to scroll, or just press and release button 2 for a middle click.

To make this work with the synaptics driver for the touchpad, you can add

       Option      "GuestMouseOff" "1"

to the synaptics device section. This will make the synaptics driver ignore the Trackpoint, so it will be handled by the mouse driver. This allowed me to disable the touchpad while making the TrackPoint work like it should.

NOTE!
With the above mouse section in my xorg.conf all this works like a charm:
  • I can press the wheel on my external USB mouse and move the mouse up and down for scrolling
  • or I can just use the wheel on the external mouse for scrolling
  • or pressing the MMB button of the trackpoint and use the trackpoint for scrolling.
  • Even horizontal scrolling works automagically in Konqueror, for Firefox/Opera see below.

Simultaneously I can use

  • a press on the external mouse's wheel
  • or the MMB of the trackpoint
for pasting the buffer. Lovely! :)
Hint:
If you don't use the middle-mouse-button for pasting and sometimes pasting things by mistake while scrolling (witch is really odd) simply set the "EmulateWheelTimeOut" to "1" as a (bloody) workaround. Middle click will only possible with pressing left and right button simultaneously!

Application specific tweaks

Configure Opera for using trackpoint horizontal scrolling

To fix horizontal scrolling in Opera, you need to edit the configfile standard_mouse.ini in e.g. /usr/share/opera/ui/ (Debian) or /opt/opera/share/opera/ini/ (Gentoo) and comment out the following lines

Button6                                                        = Back
Button7                                                        = Forward

so they look like that

;Button6                                                        = Back
;Button7                                                        = Forward

Remember, Button6 and Button7 do not so coincidental correspond with our X configuration we know from above:

Option "YAxisMapping" "6 7"

After this change you will be able to scroll vertically and horizontally with your middle button.

Firefox 3 tweaks

These settings make Firefox on Linux behave more like the Windows version. They were tested on an out of the box Fedora 10 system on a Thinkpad T61. Go into about:config, and set the following:

middlemouse.paste = false
middlemouse.contentLoadURL = false
general.autoScroll = true

Sysfs Options Reference

NOTE!
These options are current as of kernel version 2.6.29, 3 May 2009
Name Type Default Notes
sensitivity Integer 128 Sensitivity
speed Integer 97 Cursor speed
inertia Integer 6 Described as "negative inertia." It acts more like friction. High values cause the cursor to snap backward when the Trackpoint is released
reach Integer 10 Backup for Z-axis press
draghys Integer 255 Drag hysteresis (how hard it is to drag with Z-axis pressed)
mindrag Integer 20 Minimum amount of force needed to trigger dragging
thresh Integer 8 Minimum value for a Z-axis press
upthresh Integer 255 Used to generate a 'click' on Z-axis
ztime Integer 38 How sharp of a press
jenks Integer 135 Minimum curvature for double click
press_to_select Boolean 0 Press to select
skipback Boolean 0 Supress movement after drag release
ext_dev Boolean 0 Disable external device

Table info taken from here. The given link will always point to the current version of the driver. If the notes seem sparse, that's because the code is sparse. On the other hand, the Trackpoint Engineering Specification Version 4.0 contains more documentation information than anyone ever desired.

Determining TrackPoint Path ID

Both the udev and xorg.conf configuration methods require knowledge of the Path ID of the TrackPoint. In the udev configuration method, the Path ID is used to match the ID_PATH environmental variable, in the xorg.conf configuration method it is the prefix for the device file name inside the /dev/input/by-id directory. The path ID can vary between ThinkPad models, distributions (with varying kernel patches), and between kernel versions. One way to find the path ID for the TrackPoint is to use udev's path_id utility on the sysfs device path for the TrackPoint. This device path can be found using the name file which describes the TrackPoint. The process can be automated using the following shell command:

/lib/udev/path_id $(find /sys/devices/platform/i8042 -name name | xargs grep -Fl TrackPoint | sed 's/\/sys\(.*\)\/name/\1/')