Wednesday, March 19, 2014

This is a follow-up to my post from December Lenovo T440 touchpad button configuration. Except this time the support is real, or at least close to being finished. Since I am now seeing more and more hacks to get around all this I figured it's time for some info from the horse's mouth.

[update] I forgot to mention: synaptics 1.8 will have all these, the first snapshot is available here

Lenovo's newest series of laptops have a rather unusual touchpad. The trackstick does not have a set of physical buttons anymore. Instead, the top part of the touchpad serves as software-emulated buttons. In addition, the usual ClickPad-style software buttons are to be emulated on the bottom edge of the touchpad. An ASCII-art of that would look like this:

Getting this to work required a fair bit of effort, patches to synaptics, the X server and the kernel and a fair bit of trial-and-error. Kudos for getting all this sorted goes to Hans the Goede, Benjamin Tissoires, Chandler Paul and Matthew Garrett. And in the process of fixing this we also fixed a bunch of other issues that have been plaguing clickpads for a while.

The first piece in the puzzle was to add a second software button area to the synaptics driver. Option "SecondarySoftButtonAreas" now allows a configuration in the same manner as the existing one (i.e. right and middle button). Any click in that software button area won't move the cursor, so the buttons will behave just like physical buttons. Option "HasSecondarySoftButtons" defines if that button area is to be used.
Of course, we expect that button area to work out of the box, so we now ship configuration files that detect the touchpad and apply that automatically.
Update 30 Apr: Originally we tried to get this done based on the PNPID or DMI matching but a better solution is the new INPUT_PROP_TOPBUTTONPAD evdev property bit. This is now applied to all these touchpads, and the synaptics driver uses this to enable the secondary software button area. This bit will be aviailable in kernel 3.15, with stable backports happening after that.

The second piece in the puzzle was to work around the touchpad firmware. The touchpads speak two protocols, RMI4 over SMBus and PS/2. Windows uses RMI4, Linux still uses PS/2. Apparently the firmware never got tested for PS/2 so the touchpad gives us bogus data for its axis ranges. A kernel fix for this is in the pipe.
Update 30 Apr: every single touchpad of this generation needs a fix. They have been or are being merged.

Finally, the touchpad needed to be actually usable. So a bunch of patches that tweak the clickpad behaviours were merged in. If a finger is set down inside a software button area, finger movement does no longer affect the cursor. This stops the ever-so-slight but annoying movements when you execute a physical click on the touchpad. Also, there is a short timeout after a click to avoid cursor movement when the user just presses and releases the button. The timeout is short enough that if you do a click-and-hold for drag-and-drop, the cursor will move as expected. If a touch started outside a software button area, we can now use the whole touchpad for movement. And finally, a few fixes to avoid erroneous click events - we'd sometimes get the software button wrong if the event sequence is off.

Another change changed the behaviour of the touchpad when it is disabled through the "Synaptics Off" property. If you use syndaemon to disable the touchpad while typing, the buttons now work even when the touchpad is disabled. If you don't like touchpads at all and prefer to use the trackstick only, use Option "TouchpadOff" "1". This will disable everything but physical clicks on the touchpad.

On that note I'd also like to mention another touchpad bug that was fixed in the recent weeks: plenty of users reported synaptics having a finger stuck after suspend/resume or sometimes even after logging in. This was an elusive bug and finally tracked down to a mishandling of SYN_DROPPED events in synaptics 1.7 and libevdev. I won't provide a fix for synaptics 1.7 but we've fixed libevdev - please use synaptics 1.8 RC1 or later and libevdev 1.1 RC1 or later.

Update 30 Apr: If the INPUT_PROP_TOPBUTTONPAD is not available on your kernel, you can use DMI matching through udev rules. PNPID matching requires a new kernel patch as well, at which point you might as well rely on the INPUT_PROP_TOPBUTTONPAD property. An example for udev rules that we used in Fedora is below:

Update 30 Apr: For those touchpads that already have the kernel fix to adjust the min/max range, simply specifying the buttons in % of the touchpad dimensions is sufficient. For all other touchpads, you'll need to use absolute coordinates.

Fedora users: everything is being built in rawhide Update 30 Apr:, F20 and F19. The COPR listed in an earlier version of this post is not available anymore.

Thanks for synaptics 1.8 (1.7.99.1). I'm actually using it on my thinkpad yoga with kubuntu trusty.Unfortunately I can't get middle-button scrolling to work with the trackpoint, as it uses the touchpad areas as buttons. I could manage to define all 3 upper button areas, but cannot scroll with my trackpoint. Is there any sollution? (on older thinkpads: http://www.thinkwiki.org/wiki/How_to_configure_the_TrackPoint#Scrolling)

This is really driving me crazy!Any help would be much appreciated!Ray

My attempts to install the snapshot on my new t440s w/xubuntu 14.04 beta 2 have been unsuccessful (I get errors about missing xutils-macros, despite having installed them). Any idea when we might see 1.8 done and land in standard packages?

- then I found your post, saying one should put absolute numbers.First that did not work either, until I 'discovered' that the x/y-axis range reported in Xorg.0.log for my clickpad, which I relied on to do the settings, namely 1472-5112/1408-3834 where different from those determined by evtest namely 1025-5110/2024-4830.Why is X reporting such wrong numbers? Can I fix this? Or are the x/y-ranges for the clickpad in Xorg.0.log just irrelevant?

Regards, Xaver

(I'm using xf86-input-synaptics-1.7.99.1-44.4.x86_64 and OpenSuse 13.1)

Xaver: the firmware on those devices is broken and reports wrong values. We've fixed up some models in the kernel, others to come but until that's fully sorted and in your distributions, the ranges will be off.

For me, it has all been working with xf86-input-synaptics-xf86-input-synaptics-1.7.99.1 on a Lenovo T440s with Opensuse 13.1.

Now with xf86-input-synaptics-1.8.0-47.2.x86_64 it has stopped working for me: all settings for the top-row soft buttons, are without any function - irrespective of setting them percentage-wise or as numbers.

2) Should I understand INPUT_PROP_TOPBUTTONPAD as a kernel config option? Because if I do 'cat /proc/config.gz | gunzip | grep TOPBUTTON', I'm getting nothing. (For me 'uname -r' is 3.11.10-7-desktop)

3) While I'm at it, there is one thing which still drives me nuts with the clickpad: very frequently, when I try to do a left-click in the lower soft button area, the cursor jumps to the lower left of the screen - leading to erratic clicks on the application launcher and other stuff which is in the left edge of the task bar on my desktop.Is this a known feature which I can influence somehow?

I'd like to know if there is a possibility to use "touch buttons" with the trackpoint on a Lenovo T440s?

What I want is to avoid clicking down the whole clickpad and instead define 3 small areas in the very top part of the clickpad to be sensitive for touching. With this configuration one doesn't have to keep the clickpad pushed down for scrolling (which annoys me lot when reading longer texts) but just lay the finger on the right spot. A double click would be a double tapping on the right spot.

Do you see any chance to modify the configuration file in a way that the clickpad has the behaviour I described?

I love cloudid.de's idea, make the buttons for the trackpoint touch instead of click. I find the clicking to be clunky, noisy and awkward. BUT I still love using the trackpoint. I know you can use both trackpoint and touchpad, but I find if I have moved the cursor with the trackpoint, all I can do is physically click the buttons. I need to move the cursor a bit with the touch pad to do touch clicks.

I have T440 and I read your post but I must say I'm really lost what I need to do to make this work on my laptop. I added this lineATTR{[dmi/id]product_version}=="*T440*", ENV{ID_INPUT.tags}="top_softwarebutton_area"

to /lib/udev/66-xorg-synaptics-quirks.rules so now I have...ATTR{[dmi/id]product_name}=="HP MiniNote 1000", ENV{ID_INPUT.tags}="mininote_1000"ATTR{[dmi/id]product_version}=="*T440*", ENV{ID_INPUT.tags}="top_softwarebutton_area"

I have a Lenovo T440 with Mate spin of F24. It has xorg-x11-drv-synaptics-1.8.3-2.fc24.x86_64 and kernel-4.7.2-201.fc24.x86_64. I am a noob, I have never played with udev rules. I see that I can create a config file for the touch pad, and drop it at /etc/X11/xorg.conf.d ... because I have no xorg.conf file to edit.I understand what you are doing at the high level, and I think it is amazing. But i need a little spoon feeding in this, kind of more detailed steps.Thanks in advance.