| 1 |
.. _clickpads_with_right_buttons: |
| 2 |
|
| 3 |
============================================================================== |
| 4 |
Clickpads with a fake right button |
| 5 |
============================================================================== |
| 6 |
|
| 7 |
libinput relies on the kernel to label :ref:`Clickpads <touchpads_buttons_clickpads>` |
| 8 |
with the ``INPUT_PROP_BUTTONPAD`` property so it can enable the correct |
| 9 |
:ref:`clickpad_softbuttons`. Clickpads are not expected to have a right button |
| 10 |
since the whole surface can be depressed. |
| 11 |
|
| 12 |
A common bug encountered with :ref:`Clickpads <touchpads_buttons_clickpads>` |
| 13 |
is that the device advertises a physical right button where no such button |
| 14 |
exists. This is usually a bug in the firmware of the device and causes the |
| 15 |
following warning to be emitted by libinput:: |
| 16 |
|
| 17 |
"<device name> clickpad advertising right button" |
| 18 |
|
| 19 |
The user-visible effect of this is usually negligible since these devices |
| 20 |
cannot actually trigger a right click and libinput's default behaviors for |
| 21 |
clickpads work as expected. |
| 22 |
|
| 23 |
However, we should nonetheless correct the device to get rid of this warning |
| 24 |
and avoid potential issues with future features. The :ref:`device-quirks` |
| 25 |
provide a simple way to disable the fake right button on the device. The |
| 26 |
following quirk disables the right button on the MyModel laptop from the |
| 27 |
MyVendor OEM:: |
| 28 |
|
| 29 |
[MyVendor MyModel Touchpad] |
| 30 |
MatchName=Foo Bar Touchpad |
| 31 |
MatchUdevtype=touchpad |
| 32 |
MatchDMIModAlias=dmi:*:svnMyVendor:pnMyModel:* |
| 33 |
AttrEventCode=-BTN_RIGHT |
| 34 |
|
| 35 |
The name of the device can be obtained using :ref:`libinput record <libinput-record>`, |
| 36 |
the modalias match is a shell-style glob against the value of ``/sys/class/dmi/id/modalias``. |
| 37 |
In most cases, matching should be against ``svn`` (system vendor) and one of |
| 38 |
``pn`` (product name) or ``pvr`` (product version), whichever provides a |
| 39 |
useful description of the individual laptop model. See the |
| 40 |
:ref:`device-quirks` documentation for details on testing local quirks. |
| 41 |
|
| 42 |
For reference, some example commits that add such a quirk are: |
| 43 |
|
| 44 |
- `bf61ab9bb0694d0ac3d60a7f815779abfe4886e6 <https://gitlab.freedesktop.org/libinput/libinput/-/commit/bf61ab9bb0694d0ac3d60a7f815779abfe4886e6>`__ |
| 45 |
- `74fac6d040ac62048882dfb6f73da567ace6a6f5 <https://gitlab.freedesktop.org/libinput/libinput/-/commit/74fac6d040ac62048882dfb6f73da567ace6a6f5>`__ |
| 46 |
- `89cd0f990e3bee9906754d6ca8484ed5aa392249 <https://gitlab.freedesktop.org/libinput/libinput/-/commit/89cd0f990e3bee9906754d6ca8484ed5aa392249>`__ |