Lenovo Thinkpad Trackpoint Keyboard II - middle click on release after scrolling

I know this topic will potentially never end because Lenovo never was able to standardize their Trackpoint behaviour and interfaces towards Linux, Win, MacOS and any other system in the universe. Even not on some of their own devices the Trackpoint works correctly, when you use Windows.
A 62 bUSD company with 77000 employees is not able to standardize their HID’s. And on top of that the Linux community needs to fix the drawbacks of their chaos by taking over their shitty event driven trackpoint scrolling and middle click implementation to put it into the Linux kernel. And yes I know since 5.19 the problem should be solved. But it seems like it is not solved.

The problem:
I have a Lenovo Thinkpad Trackpoint Keybord II, that I’m using with its USB dongle which is part of the product.
I’m running the latest Manjaro Gnome version. (Kernel 6.6.3-1, Gnome 45.1).

Middle Button Scrolling with the Trackpoint:

Intended functionality:
While starting to move the Trackpoint, you press the middle button and then the scrolling happens.
When releasing the middle button, scrolling ends and you can use the Trackpoint as a mouse again.

Actual functionality:
Starting the scroll behaviour works fine and the page/screen gets scrolled. When releasing the middle button to stop scrolling, a middle click event happens.
→ This leads to unintended pasting of text via middle button.

Same behaviour under Linux-Kernel 6.5.
But correct behaviour under Windows.

This Keyboard behaved 2 weeks back as intended and had no problems.
Unfortunately on my second PC (running Windows) I have installed the Trackpoint Software (dont as me why I did that) and now it seems like this installation has updated or triggered something in the Firmware of the Keyboard. And now it only works correctly under Windows but not under Linux.

Any ideas?
At least the scrolling seems to work correctly, but on Linux side the event of releasing the middle button during/after scroll is interpreted as an additional middle button click, although it should be ignored.

Output from libinput debug-events when moving the Trackpoint, then pressing down the middle button (and therefore scrolling) and then releasing the middle button and further moving the trackpoint:

 event20  POINTER_MOTION          +99.180s	 -0.62/  0.00 ( -1.00/ +0.00)
 event20  POINTER_MOTION          +99.188s	 -1.00/  0.00 ( -1.00/ +0.00)
 event20  POINTER_MOTION          +99.252s	 -0.39/  0.00 ( -1.00/ +0.00)
 event20  POINTER_MOTION          +99.316s	 -0.39/  0.00 ( -1.00/ +0.00)
 event20  POINTER_MOTION          +99.332s	  0.00/  0.73 ( +0.00/ +1.00)
 event20  POINTER_MOTION          +99.376s	  0.00/  0.43 ( +0.00/ +1.00)
 event20  POINTER_SCROLL_WHEEL    +99.612s	vert 15.00/120.0* horiz 0.00/0.0 (wheel)
 event20  POINTER_SCROLL_WHEEL    +99.860s	vert 15.00/120.0* horiz 0.00/0.0 (wheel)
 event20  POINTER_SCROLL_WHEEL    +100.132s	vert 15.00/120.0* horiz 0.00/0.0 (wheel)
 event20  POINTER_SCROLL_WHEEL    +100.712s	vert 0.00/0.0 horiz 15.00/120.0* (wheel)
 event20  POINTER_SCROLL_WHEEL    +100.805s	vert 15.00/120.0* horiz 0.00/0.0 (wheel)
 event20  POINTER_BUTTON          +99.396s	BTN_MIDDLE (274) pressed, seat count: 1
 event20  POINTER_BUTTON          +102.805s	BTN_MIDDLE (274) released, seat count: 0
---This is text that was marked before and is now pasted when releasing the middle button. It is not part of the debug output---
 event20  POINTER_MOTION          +104.029s	  0.00/ -0.30 ( +0.00/ -1.00)
 event20  POINTER_MOTION          +104.046s	  0.69/  0.00 ( +1.00/ +0.00)
 event20  POINTER_MOTION          +104.061s	  0.76/  0.00 ( +1.00/ +0.00)
 event20  POINTER_MOTION          +104.073s	  0.87/  0.00 ( +1.00/ +0.00)
 event20  POINTER_MOTION          +104.093s	  0.78/  0.78 ( +1.00/ +1.00)
 event20  POINTER_MOTION          +104.109s	  0.92/  0.92 ( +1.00/ +1.00)
 event20  POINTER_MOTION          +104.125s	  0.00/  0.72 ( +0.00/ +1.00)
 event20  POINTER_MOTION          +104.141s	  0.00/  0.71 ( +0.00/ +1.00)


Looks like that the event of pressing the middle button is registered too late, after the scrolling and just before the release event.

Well Windows has only one primary clipboard, therefore autoscrolling is enabled by default, also historically. On Linux it can be enabled opt-in, but is disabled by default because it has 2 clipboards: Primary (select → middleclick) and the secondary (copy&paste). In Firefox for example you go to about:config and set middlemouse.paste to false.

Autoscrolling is a feature from Windows and was ported to Linux. Linux will not ignore the primary selection unless it was told to do so.

I had the same problem with the middle clicks and this is how I fixed it:

  1. Find the correct pointer input. In my case it was either id=9 or 10.
$ xinput list
⎡ Virtual core pointer				id=2	[master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer		id=4	[slave  pointer  (2)]
⎜   ↳ Lenovo TrackPoint Keyboard II		id=9	[slave  pointer  (2)]
⎜   ↳ Lenovo TrackPoint Keyboard II		id=10	[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)]
   ↳ Power Button				id=8	[slave  keyboard (3)]
   ↳ Lenovo TrackPoint Keyboard II		id=11	[slave  keyboard (3)]
   ↳ Lenovo TrackPoint Keyboard II		id=12	[slave  keyboard (3)]
  1. See which one has the libinput Button Scrolling Button prop. In my case it’s id=10.
$ xinput list-props "9"
Device 'Lenovo TrackPoint Keyboard II':
        Device Enabled (190):	1
        Coordinate Transformation Matrix (192):	1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
        libinput Natural Scrolling Enabled (318):	0
        libinput Natural Scrolling Enabled Default (319):	0
        libinput Left Handed Enabled (320):	0
        libinput Left Handed Enabled Default (321):	0
        libinput Send Events Modes Available (303):	1, 0
        libinput Send Events Mode Enabled (304):	0, 0
        libinput Send Events Mode Enabled Default (305):	0, 0
        Device Node (306):	"/dev/input/event9"
        Device Product ID (307):	6127, 24814
        libinput Drag Lock Buttons (322):	<no items>
        libinput Horizontal Scroll Enabled (323):	1
        libinput High Resolution Wheel Scroll Enabled (324):	1

xinput list-props "10"
Device 'Lenovo TrackPoint Keyboard II':
        Device Enabled (190):	1
        Coordinate Transformation Matrix (192):	1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
        libinput Natural Scrolling Enabled (318):	0
        libinput Natural Scrolling Enabled Default (319):	0
        libinput Scroll Methods Available (325):	0, 0, 1
        libinput Scroll Method Enabled (326):	0, 0, 1
        libinput Scroll Method Enabled Default (327):	0, 0, 1
        libinput Button Scrolling Button (328):	2
        libinput Button Scrolling Button Default (329):	2
        libinput Button Scrolling Button Lock Enabled (330):	0
        libinput Button Scrolling Button Lock Enabled Default (331):	0
        libinput Middle Emulation Enabled (332):	0
        libinput Middle Emulation Enabled Default (333):	0
        libinput Accel Speed (334):	0.000000
        libinput Accel Speed Default (335):	0.000000
        libinput Accel Profiles Available (336):	1, 1, 1
        libinput Accel Profile Enabled (337):	1, 0
        libinput Accel Profile Enabled Default (338):	1, 0, 0
        libinput Accel Custom Fallback Points (339):	<no items>
        libinput Accel Custom Fallback Step (340):	0.000000
        libinput Accel Custom Motion Points (341):	<no items>
        libinput Accel Custom Motion Step (342):	0.000000
        libinput Accel Custom Scroll Points (343):	<no items>
        libinput Accel Custom Scroll Step (344):	0.000000
        libinput Left Handed Enabled (320):	0
        libinput Left Handed Enabled Default (321):	0
        libinput Send Events Modes Available (303):	1, 0
        libinput Send Events Mode Enabled (304):	0, 0
        libinput Send Events Mode Enabled Default (305):	0, 0
        Device Node (306):	"/dev/input/event15"
        Device Product ID (307):	6127, 24814
        libinput Drag Lock Buttons (322):	<no items>
        libinput Horizontal Scroll Enabled (323):	1
        libinput Scrolling Pixel Distance (345):	15
        libinput Scrolling Pixel Distance Default (346):	15
        libinput High Resolution Wheel Scroll Enabled (324):	1
  1. Set “libinput Button Scrolling Button” to 0 with:
$ xinput --set-prop "10" "libinput Button Scrolling Button" 0
  1. If the above worked, make sure to add this line in your .profile or .xinitrc

Hi efvernier,

thank you for posting your solution!
I send a mail to the kernel.org developers who managed the driver update last year in the kernel for this Trackpoint Keyboard.

Today I installed the kernel updates 6.7.0rc6-1 and 6.6.7-4.
I’m running 6.7.0rc6-1 and it was running out of the box after installarion.

Seems like it was fixed here:
https://lore.kernel.org/all/?q=trackpoint
Check out the recent posts from Jiri.

Best regards!

1 Like

I experienced this problem since I updated linux to 6.5. I just updated to 6.6.8 and the middle click problem is gone but I since the 6.5 update I also lost the ability to change fnlock with fn+esc. Do you experience the same?

What currently do is change between android and windows mode on the keyboard physical switch. Those have different fnlock initial default state. windows mode locks F1-F12 keys and android locks media keys like volume up/down. Before the update everything worked fine.

I’m not on manjaro though but aside from the linux kernel mailing lists this is the only forum that covers this recent issue. I use debian testing.