Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Fine tuning Ubuntu on x240

Fine-tuning Ubuntu 16.04 on x240

Enabling middleclick scrolling in Ubuntu for Lenovo clickpads

With ubuntu 15.10, full clickpad support is provided by xserver-xorg-input-libinput. No further configuration needed. Tested with a T440s. (According to this)

Fine-tuning Ubuntu 14.04 on x240

Enabling middleclick scrolling in Ubuntu for Lenovo clickpads

(based on this)

The short version is that if you want to enable middleclick scrolling for Lenovo clickpads in Ubuntu, do this in a terminal:

sudo add-apt-repository ppa:bjornt/evdev
sudo apt-get update
sudo apt-get dist-upgrade

The commands above should upgrade the xserver-xorg-input-evdev package, as well as remove the xserver-xorg-input-synaptics and xserver-xorg-input-all packages.

Next you need to create a file at /usr/share/X11/xorg.conf.d/90-clickpad.conf with the following contents:

Section "InputClass"
    Identifier "Clickpad"
    MatchIsTouchpad "on"
    MatchDevicePath "/dev/input/event*"
    Driver "evdev"
    # Synaptics options come here.
    Option "Clickpad" "true"
    option "EmulatedMidButtonTime" "0"
    Option "SoftButtonAreas" "60% 0 0 5% 40% 60% 0 5%"
    Option "AreaTopEdge" "5%"
EndSection

Section "InputClass"
    Identifier   "TrackPoint"
    MatchProduct "TrackPoint"
    MatchDriver  "evdev"
    Option       "EmulateWheel"       "1"
    Option       "EmulateWheelButton" "2"
    Option       "XAxisMapping"       "6 7"
EndSection

The interesting options are SoftButtonAreas and AreaTopEdge. SoftButtonAreas specifies where the buttons should be. If you want the buttons at the top, it should generally be in the form "R 0 0 H L R 0 H", where R is where the border between the middle and right buttons, H is the height of the buttons, and L is the border between the middle and left buttons.

The AreaTopEdge turns off the top part of the touchpad, expect for clicking.

This package was created because Ubuntu doesn't quite support the clickpads that come in the newer Lenovo laptops. Ubuntu does support clickpads, and with the SoftButtonAreas config settings it's possible to have three soft buttons on the clickpad where the real buttons used to be. However, what's not supported out of the box is middleclick scrolling, where you hold the middle button and scroll with the trackpoint.

The main problem is that the clickpad is driven by synaptics and the trackpoint by evdev, and they can't communicate to generate the scroll events. Bae Taegil patched the evdev driver to basically include the synaptics driver. Björn Tillenius has taken that patch and generated a package for Ubuntu 14.04.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment