Skip to content
  • Peter Hutterer's avatar
    touchpad: Add clickpad-style software buttons · e192ecc6
    Peter Hutterer authored
    
    
    Almost all non Apple touchpads have visible markings for software button areas,
    so limit clickfinger behavior to Apple clickpads, and implement software button
    areas for others.
    
    This is a slightly fancier implementation than the simplest model and ported
    over from libtouchpad. It implements a state machine for the software buttons
    with left and right buttons currently implemented. Buttons are oriented
    left-to-right, in a horizontal bar. No random button placement allowed.
    
    In general, the procedure is:
    - if a finger sets down in the left button area, a click is a left click
    - if a finger sets down in the right button area, a click is a right click
    - if a finger leaves the button area, a click is a left click
    - if a finger starts outside the button area, a click is a left click
    
    Two timeouts are used to handle buttons more smoothly:
    - if a finger sets down in a button area but "immediately" moves over
      to a different area, that area takes effect on a click.
    - if a finger leaves a button area and "immediately" clicks or moves back into
      the area, the button still takes effect on a click.
    - if a finger changes between areas and stays there for a timeout, that area
      takes effect on a click.
    
    Note the button area states are named BOTTOM_foo to make it easier to later
    add support for a top button area such as can be found on the Thinkpad [2-5]40
    series.
    
    Co-authored-by: default avatarHans de Goede <hdegoede@redhat.com>
    Signed-off-by: default avatarPeter Hutterer <peter.hutterer@who-t.net>
    Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
    Reviewed-by: default avatarJonas Ådahl <jadahl@gmail.com>
    Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
    Reviewed-by: default avatarPeter Hutterer <peter.hutterer@who-t.net>
    e192ecc6