Bug 90170 - enable 2 finger right click on non-apple clickpads
Summary: enable 2 finger right click on non-apple clickpads
Status: RESOLVED FIXED
Alias: None
Product: Wayland
Classification: Unclassified
Component: libinput (show other bugs)
Version: unspecified
Hardware: All All
: medium normal
Assignee: Wayland bug list
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-25 09:28 UTC by Max Bruckner
Modified: 2015-05-04 21:43 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
evemu-describe of my clickpad (3.34 KB, text/plain)
2015-04-25 09:28 UTC, Max Bruckner
Details
Patch to always enable right clicks with two fingers (NOT A FIX) (717 bytes, patch)
2015-04-25 09:31 UTC, Max Bruckner
Details | Splinter Review
event-debug (as root) on GNOME with wayland (1.63 KB, text/plain)
2015-04-29 12:02 UTC, Max Bruckner
Details
udevadm-info /sys/class/input/event11 (9.38 KB, text/plain)
2015-05-02 08:09 UTC, Max Bruckner
Details

Description Max Bruckner 2015-04-25 09:28:56 UTC
Created attachment 115319 [details]
evemu-describe of my clickpad

Here (https://wiki.freedesktop.org/www/Software/libinput/clickpad-softbuttons/) it says that two finger right clicking on clickpads is only enabled on Apple clickpads, but there are many other clickpads for which right clicking with two fingers should be enabled.

I'd say that this should be enabled for every clickpad that doesn't have software button areas marked on the surface of the touchpad.

This lack of right clicking support with two fingers is what has been blocking me from using wayland, so I had to patch libinput myself to always turn this feature on.

In my particular case (a system76 galago ultra pro) the default behaviour of the clickpad uses two finger right clicks.

I'll attach the evemu-describe of my touchpad and my workaround patch (which isn't meant to go into libinput, only for other users like me that want this functionality right now and want to recompile libinput for that).
Comment 1 Max Bruckner 2015-04-25 09:31:28 UTC
Created attachment 115320 [details] [review]
Patch to always enable right clicks with two fingers (NOT A FIX)
Comment 2 Peter Hutterer 2015-04-27 06:08:57 UTC
tbh, I'm a bit hesitant to enable certain behaviours on a one-by-one basis unless there is clear documentation online that this is the default behaviour. For whole series (e.g. Apple) it's straightforward but otherwise the case isn't as clear-cut. Plus, it's a configuration toggle these days, you can enable this at runtime.

Having said that, we do have the required infrastructure in place that we could do this now. Best to attach the output of cat /sys/class/dmi/id/modalias, that contains what we need for matching. If you can find that for the other System76 laptops too (at least the ones that need this) that's going to speed things up.
Comment 3 Max Bruckner 2015-04-27 07:01:33 UTC
I've asked system76 if they can provide the modaliases of their models.

As to the modalias of my model, it says mine is a clevo W740SU because I exchanged the firmware to have proper UEFI support.

dmi:bvnAmericanMegatrendsInc.:bvr4.6.5:bd11/13/2013:svnNotebook:pnW740SU:pvrNotApplicable:rvnNotebook:rnW740SU:rvrNotApplicable:cvnNotebook:ct9:cvrN/A:

Are there so many notebooks with clickpads that don't use two finger  right clicks?
Comment 4 Max Bruckner 2015-04-27 07:07:17 UTC
As to it being configurable at runtime: That doesn't help me much if GNOME doesn't expose this option via the settings panel. But that probably means that I have to make a feature request to include such a setting.
Comment 5 Peter Hutterer 2015-04-27 07:48:01 UTC
the option is available in the gsettings:

gsettings range org.gnome.desktop.peripherals.touchpad click-method              
enum
'default'
'none'
'areas'
'fingers'

So you can set it, even though there's no GUI for it (yet).


(In reply to Max Bruckner from comment #3)
> I've asked system76 if they can provide the modaliases of their models.
> 
> As to the modalias of my model, it says mine is a clevo W740SU because I
> exchanged the firmware to have proper UEFI support.
> 
> dmi:bvnAmericanMegatrendsInc.:bvr4.6.5:bd11/13/2013:svnNotebook:pnW740SU:
> pvrNotApplicable:rvnNotebook:rnW740SU:rvrNotApplicable:cvnNotebook:ct9:cvrN/
> A:

thanks. let me know when you hear back from system76

> Are there so many notebooks with clickpads that don't use two finger  right
> clicks?

libinput provides either software buttons or clickfinger behaviour, so we need to pick one of the two defaults. afaik the majority of touchpads atm have the software button behaviour by default.
Comment 6 Max Bruckner 2015-04-28 18:09:14 UTC
So the modalias of my model seems to be 'dmi:bvnAmericanMegatrendsInc.:bvr4.6.5:bd12/12/2013:svnSystem76,Inc.:pnGalagoUltraPro:pvrgalu1:rvnNotebook:rnW740SU:rvrNotApplicable:cvnNotebook:ct9:cvrN/A:'

Quote: "The touchpad between our models is similar in nature", don't know if this helps though.

I presume that the string 'svnSystem76,Inc.' can be found in the modaliases of every model from system76.
Comment 7 Max Bruckner 2015-04-28 20:19:04 UTC
It doesn't seem like I can get access to more modalias strings.
Comment 8 Peter Hutterer 2015-04-29 01:29:21 UTC
Most of the modaliases are googleable and attached to various launchpad reports. Not sure about the touchpad names on each of them, I'm just assuming they all have synaptics.

Try this branch here please:
https://github.com/whot/libinput/tree/wip/chromebook-clickfinger
Comment 9 Max Bruckner 2015-04-29 08:34:09 UTC
Nope, doesn't work. Neither on the clevo nor on the system76 firmware (I reflashed the firmware because it didn't work, but looking at your commit, it shouldn't matther which firmware I use). (commit ca19a055c6d45b12e81eed589fe4b7c6cae99651)
Comment 10 Max Bruckner 2015-04-29 09:20:14 UTC
Okay, so after some further investigation:

* clickfinger behaviour works under Xorg, but I can't find 'libinput' in Xorg.0.log so I assume that libinput isn't in use (xf86-input-libinput has been working before).
* clickfinger behaviour doesn't work on wayland (GNOME 3.16, weston doesn't seem to work at all, so I can't test)
Comment 11 Peter Hutterer 2015-04-29 09:55:30 UTC
easiest way to test is with the ./tools/event-debug program in the libiput git repo. That way you can exclude anything else interfering.

otherwise, check for a <somenumber>-libinput.conf in /usr/share/X11/xorg.conf.d to see if the driver is assigned properly. GNOME wayland may actually overwrite the settings at runtime (called click-method, it's in the gsettings somewhere but I don't have the command available right now).
Comment 12 Max Bruckner 2015-04-29 10:59:30 UTC
Okay, xf86-input-libinput is definitely used. Still the following behavior:

GNOME 3.16, Xorg:
* with my patch: clickfinger works
* with your branch: clickfinger works

GNOME 3.16, wayland:
* with my patch: clickfinger works
* with your branch: clickfinger doesn't work
Comment 13 Peter Hutterer 2015-04-29 11:54:58 UTC
did you try the event-debug tool? that's the only way to make sure it's not something else that gets in the way.
Comment 14 Max Bruckner 2015-04-29 12:02:50 UTC
Created attachment 115436 [details]
event-debug (as root) on GNOME with wayland

Output of event-debug as root under wayland. With the chromebook branch.
Comment 15 Peter Hutterer 2015-04-30 01:45:12 UTC
uhm, I don't know what this sequence should show, sorry. It looks like some pointer motion and then a left button click, but I don't know what you physically did to get that sequence.

what does libinput-list-devices show as default for your device?

is gnome on wayland using the right libinput?
Comment 16 Peter Hutterer 2015-04-30 01:47:38 UTC
also, please make sure that after installing you trigger the new rules and that the LIBINPUT_MODEL_... tag shows up for the udev device.

udevadm info /sys/class/input/eventXYZ must show it, otherwise it won't be detected by libinput.
Comment 17 Max Bruckner 2015-04-30 11:33:26 UTC
Interestingly, libinput-list-devices shows that button areas are enabled instead of the clickfinger behavior for both Xorg and wayland:

>Device:         SynPS/2 Synaptics TouchPad
>Kernel:         /dev/input/event11
>Group:          6
>Seat:           seat0, default
>Size:           91.48x53.55mm
>Capabilities:   pointer 
>Tap-to-click:   disabled
>Left-handed:    disabled
>Nat.scrolling:  disabled
>Calibration:    n/a
>Scroll methods: *two-finger 
>Click methods:  *button-areas clickfinger

I'm not familiar with udev so I don't know how to make sure that the hwdb files are loaded.

On wayland and Xorg, gnome-shell uses /usr/lib/libinput.so.10
Comment 18 Max Bruckner 2015-04-30 11:36:10 UTC
Also libinput_drv.so from xf86-input-libinput uses /usr/lib/libinput.so.10
Comment 19 Peter Hutterer 2015-04-30 12:09:37 UTC
udevadm info /sys/class/input/event11
or udevadm test /sys/class/input/event11 for a bit more verbose and debuggable output

note that libinput-list-devices only shows the built-in defaults for the device, both xorg and gnome may have changed those defaults. but if it shows button areas that means that the udev tag or something doesn't activate properly.
Comment 20 Max Bruckner 2015-05-02 08:09:04 UTC
Created attachment 115510 [details]
udevadm-info /sys/class/input/event11

Okay, now I attached the output of udevadm-test. What concerns me is the line wich says "IMPORT builtin 'hwdb' returned non-zero".

I also tested Xorg without GNOME ( with i3 ) and the clickfinger behavior doesn't work there.
Comment 21 Peter Hutterer 2015-05-04 00:28:12 UTC
$ udevadm hwdb --test="libinput:name:SynPS/2 Synaptics TouchPad:dmi:bvnAmericanMegatrendsInc.:bvr4.6.5:bd09/11/2014:svnNotebook:pnW740SU:pvrNotApplicable:rvnNotebook:rnW740SU:rvrNotApplicable:cvnNotebook:ct9:cvrN/A:"
LIBINPUT_MODEL_SYSTEM76_CLEVO=1

The dmi string is the one from your udevadm test output. So two options here: either your udev rule or hwdb file isn't picked up correctly, or they didn't get picked up. The output has the 90-libinput-model-quirks.rules in it so it's down to the hwdb file. Check if it's installed correctly, then this as root please:
$ udevadm hwdb --update

the hwdb --test command above tells you if the hwdb is doing the right thing, once it is udevadm-info should work, then libinput should work too.
Comment 22 Max Bruckner 2015-05-04 07:55:03 UTC
Seems like 'udevadm hwdb --update' did the trick. Clickfinger behavior now works everywhere and libinput-list-devices shows the following:

>Device:         SynPS/2 Synaptics TouchPad
>Kernel:         /dev/input/event11
>Group:          6
>Seat:           seat0, default
>Size:           96.04x58.13mm
>Capabilities:   pointer 
>Tap-to-click:   disabled
>Left-handed:    disabled
>Nat.scrolling:  disabled
>Calibration:    n/a
>Scroll methods: *two-finger 
>Click methods:  button-areas *clickfinger

Thanks for your patience in debugging the udev problems with me.
Comment 23 Peter Hutterer 2015-05-04 21:43:58 UTC
commit d6867dfae013d7924dbf4c6aa71e7f7c04be75b2
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Wed Apr 29 11:03:08 2015 +1000

    touchpad: enable clickfinger by default on some System76 laptops


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.