Mouse wheel emulation broken on thinkpad keyboard

I have a Thinkpad USB keyboard with trackpoint for which openSUSE used to offer mouse wheel emulation, i.e. while pressing the middle mouse button (physically present), pushing the trackpoint up/down would scroll the current window/scrolling area. Since ca. 2 mo ago this emulation is broken and has not recovered.

The model is

lsusb
...
Bus 001 Device 002: ID 17ef:6009 Lenovo ThinkPad Keyboard with TrackPoint
...

When I use xev, and I keep pressing the middle mouse button (actually any mouse button) in the xev window, pushing the trackpoint will continue to emit MotionNotify events, even when the mouse pointer leaves the window, which is not the case when the mouse just moves across the window (the events stop being emitted when the mouse pointer leaves the window).

I could not find other reports on this bug and I have no good idea how to proceed at this moment.

The output from libinput may be of value here:

sudo libinput list-devices

The output is as follows

Device:           Lite-On Technology Corp. ThinkPad USB Keyboard with TrackPoint
Kernel:           /dev/input/event8
Group:            4
Seat:             seat0, default
Capabilities:     keyboard pointer 
Tap-to-click:     n/a
Tap-and-drag:     n/a
Tap drag lock:    n/a
Left-handed:      disabled
Nat.scrolling:    disabled
Middle emulation: n/a
Calibration:      n/a
Scroll methods:   none
Click methods:    none
Disable-w-typing: n/a
Disable-w-trackpointing: n/a
Accel profiles:   n/a
Rotation:         n/a

Device:           Lite-On Technology Corp. ThinkPad USB Keyboard with TrackPoint
Kernel:           /dev/input/event9
Group:            4
Seat:             seat0, default
Capabilities:     keyboard pointer 
Tap-to-click:     n/a
Tap-and-drag:     n/a
Tap drag lock:    n/a
Left-handed:      disabled
Nat.scrolling:    disabled
Middle emulation: disabled
Calibration:      n/a
Scroll methods:   *button
Click methods:    none
Disable-w-typing: n/a
Disable-w-trackpointing: n/a
Accel profiles:   flat *adaptive custom
Rotation:         n/a

I could use a very similar bluetooth keyboard, for which scroll wheel emulation does work:


Device:           ThinkPad Compact Bluetooth Keyboard with TrackPoint
Kernel:           /dev/input/event10
Group:            11
Seat:             seat0, default
Capabilities:     keyboard pointer 
Tap-to-click:     n/a
Tap-and-drag:     n/a
Tap drag lock:    n/a
Left-handed:      disabled
Nat.scrolling:    disabled
Middle emulation: disabled
Calibration:      identity matrix
Scroll methods:   *button
Click methods:    none
Disable-w-typing: n/a
Disable-w-trackpointing: n/a
Accel profiles:   flat *adaptive custom
Rotation:         n/a

which looks the same.

I have investigated a bit more. Using xinput list-props, I get for the broken keyboard:

xinput list-props 10
Device 'Lite-On Technology Corp. ThinkPad USB Keyboard with TrackPoint':
        Device Enabled (170):   1
        Coordinate Transformation Matrix (172): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
        libinput Natural Scrolling Enabled (301):       0
        libinput Natural Scrolling Enabled Default (302):       0
        libinput Scroll Methods Available (308):        0, 0, 1
        libinput Scroll Method Enabled (309):   0, 0, 0
        libinput Scroll Method Enabled Default (310):   0, 0, 1
        libinput Button Scrolling Button (311): 2
        libinput Button Scrolling Button Default (312): 2
        libinput Button Scrolling Button Lock Enabled (313):    0
        libinput Button Scrolling Button Lock Enabled Default (314):    0
        libinput Middle Emulation Enabled (315):        0
        libinput Middle Emulation Enabled Default (316):        0
        libinput Accel Speed (317):     0.600000
        libinput Accel Speed Default (318):     0.000000
        libinput Accel Profiles Available (319):        1, 1, 1
        libinput Accel Profile Enabled (320):   1, 0, 0
        libinput Accel Profile Enabled Default (321):   1, 0, 0
        libinput Accel Custom Fallback Points (322):    <no items>
        libinput Accel Custom Fallback Step (323):      0.000000
        libinput Accel Custom Motion Points (324):      <no items>
        libinput Accel Custom Motion Step (325):        0.000000
        libinput Accel Custom Scroll Points (326):      <no items>
        libinput Accel Custom Scroll Step (327):        0.000000
        libinput Left Handed Enabled (303):     0
        libinput Left Handed Enabled Default (304):     0
        libinput Send Events Modes Available (286):     1, 0
        libinput Send Events Mode Enabled (287):        0, 0
        libinput Send Events Mode Enabled Default (288):        0, 0
        Device Node (289):      "/dev/input/event9"
        Device Product ID (290):        6127, 24585
        libinput Drag Lock Buttons (305):       <no items>
        libinput Horizontal Scroll Enabled (306):       1
        libinput Scrolling Pixel Distance (328):        15
        libinput Scrolling Pixel Distance Default (329):        15
        libinput High Resolution Wheel Scroll Enabled (307):    1

For the working keyboard, I get:

xinput list-props 23
Device 'ThinkPad Compact Bluetooth Keyboard with TrackPoint':
        Device Enabled (170):   1
        Coordinate Transformation Matrix (172): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
        libinput Send Events Modes Available (286):     1, 0
        libinput Send Events Mode Enabled (287):        0, 0
        libinput Send Events Mode Enabled Default (288):        0, 0
        Device Node (289):      "/dev/input/event10"
        Device Product ID (290):        6127, 24648

One thing I noticed is that xinput cannot distinguish the pointer and keyboard portions of the non-working keybaord, but does so for the working bluetooth keyboard:

⎡ Virtual core pointer                          id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ Lite-On Technology Corp. ThinkPad USB Keyboard with TrackPoint    id=9    [slave  pointer  (2)]
⎜   ↳ Lite-On Technology Corp. ThinkPad USB Keyboard with TrackPoint    id=10   [slave  pointer  (2)]
⎜   ↳ keyd virtual pointer                      id=19   [slave  pointer  (2)]
⎜   ↳ ThinkPad Compact Bluetooth Keyboard with TrackPoint       id=17   [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)]
    ↳ keyd virtual keyboard                     id=18   [slave  keyboard (3)]
    ↳ Lite-On Technology Corp. ThinkPad USB Keyboard with TrackPoint    id=20   [slave  keyboard (3)]
    ↳ Lite-On Technology Corp. ThinkPad USB Keyboard with TrackPoint    id=21   [slave  keyboard (3)]
    ↳ ThinkPad Compact Bluetooth Keyboard with TrackPoint       id=23   [slave  keyboard (3)]

Is this assignment made on the driver level or configured elsewhere?

Interesting findings. Libinput handles various input devices by attribute matching. It can use device quirks for additional configuration. That is described here:
https://wayland.freedesktop.org/libinput/doc/latest/device-quirks.html
It might be interesting to see if any included quirks are a ‘full’ match to the device in question eg

sudo libinput quirks list --verbose /dev/input/event9 | grep -i "full match"

If you are using an X11 graphical desktop environment, you may be able to create a custom Xorg config to tweak the device perhaps.

FWIW, this may be of interest to you:
https://www.reddit.com/r/thinkpad/comments/6jdvxk/e470_trackpoint_scrolling_on_ubuntu/

1 Like