TrackPoint: Difference between revisions

From ArchWiki
(Add "press_to_select" to udev rule described as including this rule but not.)
m (Two words)
 
(75 intermediate revisions by 30 users not shown)
Line 1: Line 1:
[[Category:Input devices]]
[[Category:Input devices]]
[[Category:Lenovo]]
[[Category:Lenovo]]
[[es:TrackPoint]]
[[ja:トラックポイント]]
[[ja:トラックポイント]]
[[zh-CN: TrackPoint]]
[[zh-hans:TrackPoint]]
{{Expansion|Many pages in [[:Category:Lenovo]] contain more detailed configuration, which need to be merged here. See [https://wiki.ubuntuusers.de/Trackpoint] for a comparable article (untranslated)|ArchWiki:Requests#TrackPoint}}
The TrackPoint is Lenovo's trademark for the pointing stick in the middle of the keyboard. It is supported by {{Pkg|xf86-input-evdev}} and {{Pkg|xf86-input-libinput}}


The TrackPoint is Lenovo's trademark for the pointing-stick in the middle of the keyboard. It is supported by {{Pkg|xf86-input-evdev}} and {{Pkg|xf86-input-libinput}}. The evdev driver is default for [[Xorg]].  
Default [[Xorg]] behavior supports click and point. For the {{ic|evdev}} driver middle-click and scrolling requires extra configuration.


Default [[Xorg]] behavior supports click and point, but middle-click and scrolling requires extra configuration.
== GUI configuration ==


== GUI configuration ==
[[Install]] the {{AUR|gpointing-device-settings}} package.


[[Install]] the {{Pkg|gpointing-device-settings}} package.
{{Note|This software is not maintained anymore (last release in 2013).
It may not allow deep configuration when {{Pkg|xf86-input-libinput}} is used. }}


==Middle button scroll==
== Middle button scroll ==


When using {{Pkg|xf86-input-libinput}}, middle-button scrolling is enabled by default.
When using {{Pkg|xf86-input-libinput}}, middle-button scrolling is enabled by default.  


When using {{Pkg|xf86-input-evdev}}, middle-button scrolling is supported via ''xinput'' from the {{Pkg|xorg-xinput}} package. For example:
When using {{Pkg|xf86-input-evdev}}, middle-button scrolling is supported via ''xinput'' from the {{Pkg|xorg-xinput}} package. For example:


{{hc|~/.xinitrc|
{{hc|~/.xinitrc|
tpset() { xinput set-prop "''TPPS/2 IBM TrackPoint''" "$@"; }
xinput set-prop "''TPPS/2 IBM TrackPoint''" "Evdev Wheel Emulation" 1
 
xinput set-prop "''TPPS/2 IBM TrackPoint''" "Evdev Wheel Emulation Button" 2
tpset "Evdev Wheel Emulation" 1
xinput set-prop "''TPPS/2 IBM TrackPoint''" "Evdev Wheel Emulation Timeout" 200
tpset "Evdev Wheel Emulation Button" 2
xinput set-prop "''TPPS/2 IBM TrackPoint''" "Evdev Wheel Emulation Axes" 6 7 4 5
tpset "Evdev Wheel Emulation Timeout" 200
tpset "Evdev Wheel Emulation Axes" 6 7 4 5
tpset "Device Accel Constant Deceleration" 0.95
}}
}}


Line 34: Line 33:
}}
}}


== Tap to select ==
=== Xorg configuration ===


The TrackPoint supports tap-to-click functionality just as most touchpads do. To enable it manually:
Alternative to an {{ic|~/.xinitrc}} configuration, you can also create an [[Xorg#Configuration]] for the {{man|4|evdev}}driver. For example, as {{ic|/etc/X11/xorg.conf.d/20-thinkpad.conf}}, replacing {{ic|TPPS/2 IBM TrackPoint}} with the device name from ''xinput'':
 
Section "InputClass"
    Identifier "Trackpoint Wheel Emulation"
    Driver "evdev"
    MatchProduct "''TPPS/2 IBM TrackPoint''"
    MatchDevicePath "/dev/input/event*"
    Option "EmulateWheel" "true"
    Option "EmulateWheelButton" "2"
    Option "Emulate3Buttons" "false"
    Option "XAxisMapping" "6 7"
    Option "YAxisMapping" "4 5"
EndSection
 
=== Two-button trackpoints ===
 
On two-button trackpoints, using {{Pkg|xf86-input-libinput}}, the scroll button can be set to right-click button without removing functionality.
 
Replacing ''device'' with the device name from {{ic|xinput}}:
 
$ xinput set-prop "''device''" "libinput Button Scrolling Button" 3
 
== Sysfs attributes ==
 
TrackPoints expose their attributes as files in {{ic|/sys/devices/platform/i8042/serio1/}}. For example, to manually enable the tap-to-click functionality:


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


{{Note|The location of the {{ic|press_to_select}} file may be different depending on the device you are using. Systems with both a TrackPoint and a touchpad device will use the {{ic|/sys/devices/platform/i8042/serio1/serio2/}} path, whereas systems with only a TrackPoint device will use the {{ic|/sys/devices/platform/i8042/serio1/}} path.}}
{{Note|The location of the attribute files may be different depending on the device you are using. Systems with both a TrackPoint and a touchpad device will use either {{ic|/sys/devices/platform/i8042/serio1/serio2/}} or {{ic|/sys/devices/platform/i8042/serio1/serio3/}} for the path, whereas systems with only a TrackPoint device will use the {{ic|/sys/devices/platform/i8042/serio1/}} path.}}
 
=== Configuration at boot ===
 
==== udev rule ====


== udev configuration rule ==
This rule increases the trackpoint '''speed''' and enables '''tap to select''' (see above) on boot.
This rule increases the trackpoint '''speed''' and enables '''tap to select''' (see above) on boot.
Feel free to alter the values and add other modifications to files in /sys/devices/platform/i8042/serio1/serio2/. The rule also works for trackpoint-only devices.


{{hc|1=/etc/udev/rules.d/10-trackpoint.rules|2=
{{hc|1=/etc/udev/rules.d/10-trackpoint.rules|2=
Line 50: Line 75:
}}
}}


== Xorg configuration ==
==== systemd.path unit ====
 
There have been [https://bbs.archlinux.org/viewtopic.php?id=199998 reports on the forums] that the attributes/files under {{ic|/sys/devices/platform/i8042/serio1/serio2/}} appear too late in the boot process for the above (or similar) udev rule(s) to have an effect on them. Instead, a ''systemd.path'' unit can be used to configure attributes of the TrackPoint.
 
First create an executable script named e.g. {{ic|/usr/local/bin/trackpoint_configuration.sh}} that sets the TrackPoint attributes as shown in the [[#Sysfs attributes]] section.
 
The following example disables the trackpoint in some laptops, leaving the trackpoint left and right buttons (the ones over the touchpad) keep working just fine (however, if one disables the TrackPoint directly from the UEFI/BIOS settings, right and left trackpoint buttons will necessarily be disabled).
{{hc|/usr/local/bin/trackpoint_configuration.sh|2=
#!/bin/bash
echo -n 0 > /sys/devices/platform/i8042/serio1/serio2/sensitivity
echo -n 0 > /sys/devices/platform/i8042/serio1/serio2/speed
}}
 
Afterwards, create the following systemd units. Make sure that all attributes modified by the script are listed with {{ic|PathExists}}.
 
{{hc|/etc/systemd/system/trackpoint_parameters.path|2=
[Unit]
Description=Watch for, and modify, Trackpoint attributes
 
[Path]
PathExists=/sys/devices/platform/i8042/serio1/press_to_select
 
[Install]
WantedBy=default.target
}}
 
{{hc|/etc/systemd/system/trackpoint_parameters.service|2=
[Unit]
Description=Set TrackPoint attributes
 
[Service]
ExecStart=/usr/local/bin/trackpoint_configuration.sh
}}
 
Finally, [[enable]] and [[start]] the {{ic|trackpoint_parameters.path}} systemd unit.
 
==== udev hwdb entry ====
 
{{Out of date|1=Since around [https://who-t.blogspot.com/2018/06/libinput-and-its-device-quirks-files.html version 1.12] libinput stopped using udev hwdb for device-specific overrides and moved to ini-style files independent of hwdb (see [[#device-quirks]]).}}
 
Libinput applies its own parameters to sysfs based on entries in the [https://github.com/systemd/systemd/blob/master/hwdb.d/70-pointingstick.hwdb udev hardware database]. This is the behavior on systems running a Wayland compositor, as libinput is the only supported input interface in that environment. Changes made prior to the start of a Wayland compositor or X session will be overwritten.
 
To override libinput's default settings, add a local hwdb entry:
 
{{hc|/etc/udev/hwdb.d/99-trackpoint.hwdb|2=
evdev:name:TPPS/2 IBM TrackPoint:dmi:bvn*:bvr*:bd*:svnLENOVO:pn*:pvrThinkPad??60?:*
  POINTINGSTICK_SENSITIVITY=250
}}
 
You can find various vendor/model keys in the [https://github.com/systemd/systemd/blob/master/hwdb.d/70-pointingstick.hwdb udev hardware database]. Note that since [https://gitlab.freedesktop.org/libinput/libinput/-/commit/3669fa10dff95371658647272ef7ac7a3ef29a61 this commit] libinput ignores the POINTINGSTICK_CONST_ACCEL parameter and uses POINTINGSTICK_SENSITIVITY. The range is 0-255.
 
[[Map scancodes to keycodes#Updating the Hardware Database Index|Update the hardware database index]], then to test the changes prior to restarting your compositor or X session, first find your device input node {{ic|/dev/input/eventX}} using:
 
# libinput list-devices
 
Run the following to generate some debug output:


To enable scrolling with the TrackPoint while holding down the middle mouse button, create {{ic|/etc/X11/xorg.conf.d/20-thinkpad.conf}}, replacing {{ic|TPPS/2 IBM TrackPoint}} with the device name from ''xinput'':
# udevadm trigger /sys/class/input/eventX
# udevadm test /sys/class/input/eventX


Section "InputClass"
{{Note|This will not actually apply the parameters from hwdb, but you can verify the changes in the output of the {{ic|udevadm test}} command.}}
    Identifier "Trackpoint Wheel Emulation"
 
    MatchProduct "''TPPS/2 IBM TrackPoint''"
Finally, restart your Wayland compositor or X session to apply the changes.
    MatchDevicePath "/dev/input/event*"
 
    Option "EmulateWheel" "true"
==== device-quirks ====
    Option "EmulateWheelButton" "2"
 
    Option "Emulate3Buttons" "false"
With the {{ic|libinput}} switch to the new device-quirks {{ic|.ini}}-style configuration files, you can adjust trackpoint parameters via local overrides in {{ic|/etc/libinput/}}.
    Option "XAxisMapping" "6 7"
 
    Option "YAxisMapping" "4 5"
For example, to override the pointing speed, create the following file:
EndSection
 
{{hc|/etc/libinput/local-overrides.quirks|2=
[Trackpoint Override]
MatchUdevType=pointingstick
AttrTrackpointMultiplier=0.75
}}
 
For more information, see [https://wayland.freedesktop.org/libinput/doc/latest/device-quirks.html#installing-temporary-local-device-quirks libinput: Installing temporary local device quirks]
 
{{Note|Model quirks are internal API and may change at any time. No backwards-compatibility is guaranteed. Local overrides should only be used until the distribution updates the libinput packages.}}


== Troubleshooting ==
== Troubleshooting ==


===Trackpoint is not detected or is detected after X minutes===
=== Trackpoint is not detected or is detected after X minutes ===
This appears to be a kernel bug. See: https://bugzilla.kernel.org/show_bug.cgi?id=33292
 
This appears to be a kernel bug.[https://bugzilla.kernel.org/show_bug.cgi?id=33292]
 
A workaround is passing {{ic|1=proto=bare}} to the {{ic|psmouse}} module as a [[kernel module parameter]]. However, this disables scrolling with the clickpad and the two-finger middle click.
 
psmouse proto=bare
 
For some ThinkPad models with Elantech touchpad the Trackpoint and the corresponding hardware buttons do not get recognized. The above mentioned command does work but disables the two finger scrolling on the touchpad. To keep two finger interactions possible, use the following kernel module parameter:
 
psmouse elantech_smbus=0
 
=== Trackpoint buttons do not always work ===
 
If you discover that disabling the touchpad in the BIOS disables the wrong buttons and/or that the trackpoint buttons are very unreliable a workaround is to pass {{ic|1=proto=imps}} to the {{ic|psmouse}} module as a [[kernel module parameter]].
 
=== Two-finger scroll ceases to work after suspending ===
 
On some laptops, psmouse seems to fail on start up, or after suspend:
 
psmouse serio1: synaptics: Unable to initialize device
 
One workaround is to use add {{ic|1=synaptics_intertouch=0}} to {{ic|psmouse}} as a [[kernel module parameter]].
 
=== Trackpoint moves on its own ===
 
On some ThinkPads the TrackPoint cursor moves spontaneously after release and it does not stop. This happens because of a low value of the {{ic|drift_time}} parameter (e.g. 5), you need to change it to 25 or 30 to fix the problem. This can be done with a [[udev]] rule:
 
{{hc|/etc/udev/rules.d/10-trackpoint.rules|2=
ACTION=="add", SUBSYSTEM=="input", ATTR{name}=="TPPS/2 IBM TrackPoint", ATTR{device/drift_time}="25"
}}
 
{{Style|The above reads as the problem was definitely identified and fixed, which contradicts the the following paragraph (which may also not always work?)}}
 
But, this method not always work. So, as last chance changing the psmouse protocol to "bare", will fix the problem. This way the trackpoint will be identified as a "PS/2 Generic Mouse" and not controlled by the original kernel driver anymore.
 
So, add {{ic|1=psmouse.proto=bare}} to your [[kernel parameters]].
 
=== Middle-click paste triggered while scrolling ===


A workaround is passing proto=bare to the psmouse module. However this disable scrolling with the clickpad and the two finger middle click.
Clicking the middle mouse button pastes from the [[Clipboard#Selections|PRIMARY selection]] by default, which is an inconvenience when using the middle mouse button to scroll with the TrackPoint. See [[Clipboard#Disabling middle-click paste]] to disable this behavior.
modprobe psmouse proto=bare


== See also ==
== See also ==


* [http://www.thinkwiki.org/wiki/How_to_configure_the_TrackPoint How to configure the TrackPoint - ThinkWiki]
* [https://www.thinkwiki.org/wiki/How_to_configure_the_TrackPoint How to configure the TrackPoint - ThinkWiki]
* [https://gist.githubusercontent.com/noromanba/11261595/raw/478cf4c4d9b63f1e59364a6f427ffccd63db5e1e/thinkpad-trackpoint-speed.mkd Trackpoint speed]
* [https://gist.githubusercontent.com/noromanba/11261595/raw/478cf4c4d9b63f1e59364a6f427ffccd63db5e1e/thinkpad-trackpoint-speed.mkd Trackpoint speed]
* [https://askubuntu.com/questions/37824/what-is-the-best-way-to-configure-a-thinkpads-trackpoint/553926 What is the best way to configure a Thinkpad's TrackPoint?]
* [https://askubuntu.com/questions/37824/what-is-the-best-way-to-configure-a-thinkpads-trackpoint/553926 What is the best way to configure a Thinkpad's TrackPoint?]

Latest revision as of 21:32, 4 March 2024

The TrackPoint is Lenovo's trademark for the pointing stick in the middle of the keyboard. It is supported by xf86-input-evdev and xf86-input-libinput.

Default Xorg behavior supports click and point. For the evdev driver middle-click and scrolling requires extra configuration.

GUI configuration

Install the gpointing-device-settingsAUR package.

Note: This software is not maintained anymore (last release in 2013). It may not allow deep configuration when xf86-input-libinput is used.

Middle button scroll

When using xf86-input-libinput, middle-button scrolling is enabled by default.

When using xf86-input-evdev, middle-button scrolling is supported via xinput from the xorg-xinput package. For example:

~/.xinitrc
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
xinput set-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation Axes" 6 7 4 5
Note:
  • Devices names can be listed with xinput --list or hwinfo.
  • The "Device Accel Constant Deceleration" line configures the sensitivity of the trackpoint.

Xorg configuration

Alternative to an ~/.xinitrc configuration, you can also create an Xorg#Configuration for the evdev(4)driver. For example, as /etc/X11/xorg.conf.d/20-thinkpad.conf, replacing TPPS/2 IBM TrackPoint with the device name from xinput:

Section "InputClass"
    Identifier	"Trackpoint Wheel Emulation"
    Driver "evdev"
    MatchProduct	"TPPS/2 IBM TrackPoint"
    MatchDevicePath	"/dev/input/event*"
    Option		"EmulateWheel"		"true"
    Option		"EmulateWheelButton"	"2"
    Option		"Emulate3Buttons"	"false"
    Option		"XAxisMapping"		"6 7"
    Option		"YAxisMapping"		"4 5"
EndSection

Two-button trackpoints

On two-button trackpoints, using xf86-input-libinput, the scroll button can be set to right-click button without removing functionality.

Replacing device with the device name from xinput:

$ xinput set-prop "device" "libinput Button Scrolling Button" 3

Sysfs attributes

TrackPoints expose their attributes as files in /sys/devices/platform/i8042/serio1/. For example, to manually enable the tap-to-click functionality:

# echo -n 1 > /sys/devices/platform/i8042/serio1/press_to_select
Note: The location of the attribute files may be different depending on the device you are using. Systems with both a TrackPoint and a touchpad device will use either /sys/devices/platform/i8042/serio1/serio2/ or /sys/devices/platform/i8042/serio1/serio3/ for the path, whereas systems with only a TrackPoint device will use the /sys/devices/platform/i8042/serio1/ path.

Configuration at boot

udev rule

This rule increases the trackpoint speed and enables tap to select (see above) on boot.

/etc/udev/rules.d/10-trackpoint.rules
ACTION=="add", SUBSYSTEM=="input", ATTR{name}=="TPPS/2 IBM TrackPoint", ATTR{device/sensitivity}="240", ATTR{device/press_to_select}="1"

systemd.path unit

There have been reports on the forums that the attributes/files under /sys/devices/platform/i8042/serio1/serio2/ appear too late in the boot process for the above (or similar) udev rule(s) to have an effect on them. Instead, a systemd.path unit can be used to configure attributes of the TrackPoint.

First create an executable script named e.g. /usr/local/bin/trackpoint_configuration.sh that sets the TrackPoint attributes as shown in the #Sysfs attributes section.

The following example disables the trackpoint in some laptops, leaving the trackpoint left and right buttons (the ones over the touchpad) keep working just fine (however, if one disables the TrackPoint directly from the UEFI/BIOS settings, right and left trackpoint buttons will necessarily be disabled).

/usr/local/bin/trackpoint_configuration.sh
#!/bin/bash
echo -n 0 > /sys/devices/platform/i8042/serio1/serio2/sensitivity
echo -n 0 > /sys/devices/platform/i8042/serio1/serio2/speed

Afterwards, create the following systemd units. Make sure that all attributes modified by the script are listed with PathExists.

/etc/systemd/system/trackpoint_parameters.path
[Unit]
Description=Watch for, and modify, Trackpoint attributes

[Path]
PathExists=/sys/devices/platform/i8042/serio1/press_to_select

[Install]
WantedBy=default.target
/etc/systemd/system/trackpoint_parameters.service
[Unit]
Description=Set TrackPoint attributes

[Service]
ExecStart=/usr/local/bin/trackpoint_configuration.sh

Finally, enable and start the trackpoint_parameters.path systemd unit.

udev hwdb entry

This article or section is out of date.

Reason: Since around version 1.12 libinput stopped using udev hwdb for device-specific overrides and moved to ini-style files independent of hwdb (see #device-quirks). (Discuss in Talk:TrackPoint)

Libinput applies its own parameters to sysfs based on entries in the udev hardware database. This is the behavior on systems running a Wayland compositor, as libinput is the only supported input interface in that environment. Changes made prior to the start of a Wayland compositor or X session will be overwritten.

To override libinput's default settings, add a local hwdb entry:

/etc/udev/hwdb.d/99-trackpoint.hwdb
evdev:name:TPPS/2 IBM TrackPoint:dmi:bvn*:bvr*:bd*:svnLENOVO:pn*:pvrThinkPad??60?:*
  POINTINGSTICK_SENSITIVITY=250

You can find various vendor/model keys in the udev hardware database. Note that since this commit libinput ignores the POINTINGSTICK_CONST_ACCEL parameter and uses POINTINGSTICK_SENSITIVITY. The range is 0-255.

Update the hardware database index, then to test the changes prior to restarting your compositor or X session, first find your device input node /dev/input/eventX using:

# libinput list-devices

Run the following to generate some debug output:

# udevadm trigger /sys/class/input/eventX
# udevadm test /sys/class/input/eventX
Note: This will not actually apply the parameters from hwdb, but you can verify the changes in the output of the udevadm test command.

Finally, restart your Wayland compositor or X session to apply the changes.

device-quirks

With the libinput switch to the new device-quirks .ini-style configuration files, you can adjust trackpoint parameters via local overrides in /etc/libinput/.

For example, to override the pointing speed, create the following file:

/etc/libinput/local-overrides.quirks
[Trackpoint Override]
MatchUdevType=pointingstick
AttrTrackpointMultiplier=0.75

For more information, see libinput: Installing temporary local device quirks

Note: Model quirks are internal API and may change at any time. No backwards-compatibility is guaranteed. Local overrides should only be used until the distribution updates the libinput packages.

Troubleshooting

Trackpoint is not detected or is detected after X minutes

This appears to be a kernel bug.[1]

A workaround is passing proto=bare to the psmouse module as a kernel module parameter. However, this disables scrolling with the clickpad and the two-finger middle click.

psmouse proto=bare

For some ThinkPad models with Elantech touchpad the Trackpoint and the corresponding hardware buttons do not get recognized. The above mentioned command does work but disables the two finger scrolling on the touchpad. To keep two finger interactions possible, use the following kernel module parameter:

psmouse elantech_smbus=0

Trackpoint buttons do not always work

If you discover that disabling the touchpad in the BIOS disables the wrong buttons and/or that the trackpoint buttons are very unreliable a workaround is to pass proto=imps to the psmouse module as a kernel module parameter.

Two-finger scroll ceases to work after suspending

On some laptops, psmouse seems to fail on start up, or after suspend:

psmouse serio1: synaptics: Unable to initialize device

One workaround is to use add synaptics_intertouch=0 to psmouse as a kernel module parameter.

Trackpoint moves on its own

On some ThinkPads the TrackPoint cursor moves spontaneously after release and it does not stop. This happens because of a low value of the drift_time parameter (e.g. 5), you need to change it to 25 or 30 to fix the problem. This can be done with a udev rule:

/etc/udev/rules.d/10-trackpoint.rules
ACTION=="add", SUBSYSTEM=="input", ATTR{name}=="TPPS/2 IBM TrackPoint", ATTR{device/drift_time}="25"

This article or section needs language, wiki syntax or style improvements. See Help:Style for reference.

Reason: The above reads as the problem was definitely identified and fixed, which contradicts the the following paragraph (which may also not always work?) (Discuss in Talk:TrackPoint)

But, this method not always work. So, as last chance changing the psmouse protocol to "bare", will fix the problem. This way the trackpoint will be identified as a "PS/2 Generic Mouse" and not controlled by the original kernel driver anymore.

So, add psmouse.proto=bare to your kernel parameters.

Middle-click paste triggered while scrolling

Clicking the middle mouse button pastes from the PRIMARY selection by default, which is an inconvenience when using the middle mouse button to scroll with the TrackPoint. See Clipboard#Disabling middle-click paste to disable this behavior.

See also