1.. _clickpad_softbuttons: 2 3============================================================================== 4Clickpad software button behavior 5============================================================================== 6 7"Clickpads" are touchpads without separate physical buttons. Instead, the 8whole touchpad acts as a button and left or right button clicks are 9distinguished by :ref:`the location of the fingers <software_buttons>` or 10the :ref:`number of fingers on the touchpad <clickfinger>`. 11"ClickPad" is a trademark by `Synaptics Inc. <http://www.synaptics.com/en/clickpad.php>`_ 12but for simplicity we refer to any touchpad with the above feature as Clickpad, 13regardless of the manufacturer. 14 15The kernel marks clickpads with the 16`INPUT_PROP_BUTTONPAD <https://www.kernel.org/doc/Documentation/input/event-codes.txt>`_ 17property. Without this property, libinput would not know whether a touchpad 18is a clickpad or not. To perform a right-click on a Clickpad, libinput 19provides :ref:`software_buttons` and :ref:`clickfinger`. 20 21.. note:: The term "click" refers refer to a physical button press 22 and/or release of the touchpad, the term "button event" refers to 23 the events generated by libinput in response to a click. 24 25.. _software_buttons: 26 27------------------------------------------------------------------------------ 28Software button areas 29------------------------------------------------------------------------------ 30 31The bottom of the touchpad is split into three distinct areas generate left, 32middle or right button events on click. The height of the button area 33depends on the hardware but is usually around 10mm. 34 35.. figure :: software-buttons-visualized.svg 36 :align: center 37 38 The locations of the virtual button areas. 39 40 41Left, right and middle button events can be triggered as follows: 42 43- if a finger is in the main area or the left button area, a click generates 44 left button events. 45- if a finger is in the right area, a click generates right button events. 46- if a finger is in the middle area, a click generates middle button events. 47 48.. figure:: software-buttons.svg 49 :align: center 50 51 Left, right and middle-button click with software button areas 52 53The middle button is always centered on the touchpad and smaller in size 54than the left or right button. The actual size is device-dependent. Many 55touchpads do not have visible markings so the exact location of the button 56is unfortunately not visibly obvious. 57 58.. note:: If :ref:`middle button emulation <middle_button_emulation>` is 59 enabled on a clickpad, only left and right button areas are 60 available. 61 62If fingers are down in the main area in addition to fingers in the 63left or right button area, those fingers are are ignored. 64A release event always releases the buttons logically down, regardless of 65the current finger position 66 67.. figure:: software-buttons-thumbpress.svg 68 :align: center 69 70 Only the location of the thumb determines whether it is a left, right or 71 middle click. 72 73The movement of a finger can alter the button area behavior: 74 75- if a finger starts in the main area and moves into the software button 76 area, the software buttons do not apply to that finger 77- once a finger has moved out of the button area, it cannot move back in and 78 trigger a right or middle button event 79- a finger moving within the software button area does not move the pointer 80- once a finger moves out out of the button area it will control the 81 pointer (this only applies if there is no other finger down on the 82 touchpad) 83 84.. figure:: software-buttons-conditions.svg 85 :align: center 86 87 **Left:** moving a finger into the right button area does not trigger a 88 right-button click. 89 **Right:** moving within the button areas does not generate pointer 90 motion. 91 92On some touchpads, notably the 2015 Lenovo X1 Carbon 3rd series, the very 93bottom end of the touchpad is outside of the sensor range but it is possible 94to trigger a physical click there. To libinput, the click merely shows up as 95a left button click without any positional finger data and it is 96impossible to determine whether it is a left or a right click. libinput 97ignores such button clicks, this behavior is intentional. 98 99.. _clickfinger: 100 101------------------------------------------------------------------------------ 102Clickfinger behavior 103------------------------------------------------------------------------------ 104 105This is the default behavior on Apple touchpads. 106Here, a left, right, middle button event is generated when one, two, or 107three fingers are held down on the touchpad when a physical click is 108generated. The location of the fingers does not matter and there are no 109software-defined button areas. 110 111.. figure:: clickfinger.svg 112 :align: center 113 114 One, two and three-finger click with Clickfinger behavior 115 116On some touchpads, libinput imposes a limit on how the fingers may be placed 117on the touchpad. In the most common use-case this allows for a user to 118trigger a click with the thumb while leaving the pointer-moving finger on 119the touchpad. 120 121.. figure:: clickfinger-distance.svg 122 :align: center 123 124 Illustration of the distance detection algorithm 125 126In the illustration above the red area marks the proximity area around the 127first finger. Since the thumb is outside of that area libinput considers the 128click a single-finger click rather than a two-finger click. 129 130.. _special_clickpads: 131 132------------------------------------------------------------------------------ 133Special Clickpads 134------------------------------------------------------------------------------ 135 136The Lenovo \*40 series laptops have a clickpad that provides two software button sections, one at 137the top and one at the bottom. See :ref:`Lenovo \*40 series touchpad support <t440_support>` 138for details on the top software button. 139 140Some Clickpads, notably some Cypress ones, perform right button detection in 141firmware and appear to userspace as if the touchpad had physical buttons. 142While physically clickpads, these are not handled by the software and 143treated like traditional touchpads. 144