Bug 100694 - Middle trackpoint button not recognized on Thinkpad E470
Summary: Middle trackpoint button not recognized on Thinkpad E470
Status: RESOLVED NOTOURBUG
Alias: None
Product: xorg
Classification: Unclassified
Component: Input/synaptics (show other bugs)
Version: 7.7 (2012.06)
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Peter Hutterer
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-16 13:51 UTC by VeryRealUser
Modified: 2017-05-28 14:21 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments
evemu-record log with proto=imps (1.92 KB, text/plain)
2017-04-19 12:32 UTC, VeryRealUser
no flags Details
evemu-record log without proto=imps (2.19 KB, text/plain)
2017-04-19 12:32 UTC, VeryRealUser
no flags Details

Description VeryRealUser 2017-04-16 13:51:27 UTC
The middle mouse button of the trackpoint is not recognized by default.
This concerns the Thinkpad E470 (20H2).

$ xinput list-props 12
Device 'TPPS/2 IBM TrackPoint':
 Device Enabled (140): 1
 Coordinate Transformation Matrix (142): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
 Device Accel Profile (266): 0
 Device Accel Constant Deceleration (267): 1.000000
 Device Accel Adaptive Deceleration (268): 1.000000
 Device Accel Velocity Scaling (269): 10.000000
 Device Product ID (260): 2, 10
 Device Node (261): "/dev/input/event13"
 Evdev Axis Inversion (306): 0, 0
 Evdev Axes Swap (308): 0
 Axis Labels (309): "Rel X" (150), "Rel Y" (151)
 Button Labels (310): "Button Left" (143), "Button Unknown" (305), "Button Right" (145), "Button Wheel Up" (146), "Button Wheel Down" (147), "Button Horiz Wheel Left" (148), "Button Horiz Wheel Right" (149)


dmesg reports that trackpoint.c of the kernel fails to retreive extended button data:

[...]
[ 5276.513617] psmouse serio7: trackpoint: failed to get extended button data
[ 5280.377455] psmouse serio7: trackpoint: IBM TrackPoint firmware: 0x0e, buttons: 0/0
[...]

Installing xserver-xorg-input-libinput-hwe-16.04 (on Ubuntu 16.04.2) and reloading psmouse with proto=imps enabled the trackpoint's middle button. But therefore two-finger scrolling using the touchpad won't work anymore.

This issue seems to have much in common with https://bugs.freedesktop.org/show_bug.cgi?id=88609
Comment 1 Peter Hutterer 2017-04-18 02:27:41 UTC
looks like this is going to be a kernel issue. when you run evemu-record, do you see middle button events coming from the trackpoint? if not, not much libinput can do.
Comment 2 VeryRealUser 2017-04-19 12:30:48 UTC
(In reply to Peter Hutterer from comment #1)
> looks like this is going to be a kernel issue. when you run evemu-record, do
> you see middle button events coming from the trackpoint? if not, not much
> libinput can do.

When running evemu-record and psmouse loaded with proto=imps, the middle button is detected:

[...]
E: 0.000000 0001 0112 0001      # EV_KEY / BTN_MIDDLE           1
E: 0.000000 0000 0000 0000      # ------------ SYN_REPORT (0) ----------
E: 0.103450 0001 0112 0000      # EV_KEY / BTN_MIDDLE           0
E: 0.103450 0000 0000 0000      # ------------ SYN_REPORT (0) ----------
[...]
(see evemu-record-proto-imps.log)

When psmouse is loaded without proto=imps, the middle button is not detected (see evemu-record.log).
Comment 3 VeryRealUser 2017-04-19 12:32:15 UTC
Created attachment 130916 [details]
evemu-record log with proto=imps
Comment 4 VeryRealUser 2017-04-19 12:32:45 UTC
Created attachment 130917 [details]
evemu-record log without proto=imps
Comment 5 VeryRealUser 2017-04-19 17:24:19 UTC
I think I can confirm that this is a kernel bug. I dove a bit into the psmouse module, especially trackpoint.c:

- as dmesg reports extended button can not be read, originating from https://github.com/torvalds/linux/blob/v4.8/drivers/input/mouse/trackpoint.c#L383
- this is due to the second ps2 command in trackpoint_read returning -1 https://github.com/torvalds/linux/blob/v4.8/drivers/input/mouse/trackpoint.c#L53

Neither do I have any experience with the ps2 interface, nor do I the trackpoint especially. But it seems like Lenovo might have changed something in the trackpoint protocol for this model? Or it's a kernel bug. I don't really know how to investigate any further atm.

A quick and dirty fix is to enable the middle button like it is done here: https://github.com/torvalds/linux/blob/v4.8/drivers/input/mouse/trackpoint.c#L398, e.g. by setting button_info to 0x33, although it failed.
Comment 6 Peter Hutterer 2017-04-20 00:11:26 UTC
right, so basically if you force the protocol to imps, you're leaving the touchpad's firmware in mouse emulation mode. Look at the evemu, it looks like a three-button mouse (rel x/y and some buttons). That means you lose any of the software-enabled touchpad features, scrolling is just one of those.

If you don't get any middle button events in evemu, then libinput won't see them either, not much we can do there. So this is, as you already discovered, a kernel bug and needs to be fixed there.

Best to bring this up on the linux-input list, make sure you cc Andrew Duggan on this (cc-d here now too). For now, I'll have to close this here since there isn't much I can do in userspace, let's punt this to the kernel instead.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.