touchpad-pressure.rst 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. .. _touchpad_pressure:
  2. ==============================================================================
  3. Touchpad pressure-based touch detection
  4. ==============================================================================
  5. libinput uses the touchpad pressure values and/or touch size values to
  6. detect whether a finger has been placed on the touchpad. This is
  7. :ref:`kernel_pressure_information` and combines with a libinput-specific hardware
  8. database to adjust the thresholds on a per-device basis. libinput uses
  9. these thresholds primarily to filter out accidental light touches but
  10. the information is also used for some :ref:`palm_detection`.
  11. Most devices only support one of either touch pressure or touch size.
  12. libinput uses whichever is available but a preference is given to touch size
  13. as it provides more specific information. Since most devices only provide
  14. one type anyway, this internal preference does not usually matter.
  15. Pressure and touch size thresholds are **not** directly configurable by the
  16. user. Instead, libinput provides these thresholds for each device where
  17. necessary. See :ref:`touchpad_pressure_hwdb` for instructions on how to adjust
  18. the pressure ranges and :ref:`touchpad_touch_size_hwdb` for instructions on
  19. how to adjust the touch size ranges.
  20. .. _kernel_pressure_information:
  21. ------------------------------------------------------------------------------
  22. Information provided by the kernel
  23. ------------------------------------------------------------------------------
  24. The kernel sends multiple values to inform userspace about a finger touching
  25. the touchpad. The most basic is the ``EV_KEY/BTN_TOUCH`` boolean event
  26. that simply announces physical contact with the touchpad. The decision when
  27. this event is sent is usually made by the kernel driver and may depend on
  28. device-specific thresholds. These thresholds are transparent to userspace
  29. and cannot be modified. On touchpads where pressure or touch size is not
  30. available, libinput uses ``BTN_TOUCH`` to determine when a finger is
  31. logically down.
  32. Many contemporary touchpad devices provide an absolute pressure axis in
  33. addition to ``BTN_TOUCH``. This pressure generally increases as the pressure
  34. increases, however few touchpads are capable of detecting true pressure. The
  35. pressure value is usually related to the covered area - as the pressure
  36. increases a finger flattens and thus covers a larger area. The range
  37. provided by the kernel is not mapped to a specific physical range and
  38. often requires adjustment. Pressure is sent by the ``ABS_PRESSURE`` axis
  39. for single-touch touchpads or ``ABS_MT_PRESSURE`` on multi-touch capable
  40. touchpads. Some devices can detect multiple fingers but only provide
  41. ``ABS_PRESSURE``.
  42. Some devices provide additional touch size information through
  43. the ``ABS_MT_TOUCH_MAJOR/ABS_MT_TOUCH_MINOR`` axes and/or
  44. the ``ABS_MT_WIDTH_MAJOR/ABS_MT_WIDTH_MINOR`` axes. These axes specify
  45. the size of the touch ellipse. While the kernel documentation specifies how
  46. these axes are supposed to be mapped, few devices forward reliable
  47. information. libinput uses these values together with a device-specific
  48. :ref:`device-quirks` entry. In other words, touch size detection does not work
  49. unless a device quirk is present for the device.