what-is-libinput.rst 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. .. _what_is_libinput:
  2. ==============================================================================
  3. What is libinput?
  4. ==============================================================================
  5. This page describes what libinput is, but more importantly it also describes
  6. what libinput is **not**.
  7. .. _what_libinput_is:
  8. ------------------------------------------------------------------------------
  9. What libinput is
  10. ------------------------------------------------------------------------------
  11. libinput is an input stack for processes that need to provide events from
  12. commonly used input devices. That includes mice, keyboards, touchpads,
  13. touchscreens and graphics tablets. libinput handles device-specific quirks
  14. and provides an easy-to-use API to receive events from devices.
  15. libinput is designed to handle all input devices available on a system but
  16. it is possible to limit which devices libinput has access to.
  17. For example, the use of xf86-input-libinput depends on xorg.conf snippets
  18. for specific devices. But libinput works best if it handles all input
  19. devices as this allows for smarter handling of features that affect multiple
  20. devices.
  21. libinput restricts device-specific features to those devices that require
  22. those features. One example for this are the top software buttons on the
  23. touchpad in the Lenovo T440. While there may be use-cases for providing top
  24. software buttons on other devices, libinput does not do so.
  25. `This introductory blog post from 2015
  26. <https://who-t.blogspot.com/2015/06/libinput-and-lack-of-device-types.html>`_
  27. describes some of the motivations.
  28. .. _what_libinput_is_not:
  29. ------------------------------------------------------------------------------
  30. What libinput is not
  31. ------------------------------------------------------------------------------
  32. libinput is **not** a project to support experimental devices. Unless a
  33. device is commonly available off-the-shelf, libinput will not support this
  34. device. libinput can serve as a useful base for getting experimental devices
  35. enabled and reduce the amount of boilerplate required. But such support will
  36. not land in libinput master until the devices are commonly available.
  37. libinput is **not** a box of legos. It does not provide the pieces to
  38. assemble a selection of features. Many features can be disabled through
  39. configuration options, but some features are hardcoded and/or only available
  40. on some devices. There are plenty of use-cases to provide niche features,
  41. but libinput is not the place to support these.
  42. libinput is **not** a showcase for features. There are a lot of potential
  43. features that could be provided on input devices. But unless they have
  44. common usage, libinput is not the place to implement them. Every feature
  45. multiplies the maintenance effort, any feature that is provided but unused
  46. is a net drain on the already sparse developer resources libinput has
  47. available.
  48. libinput is boring. It does not intend to break new grounds on how devices
  49. are handled. Instead, it takes best practice and the common use-cases and
  50. provides it in an easy-to-consume package for compositors or other processes
  51. that need those interactions typically expected by users.
  52. .. _libinput-wayland:
  53. ------------------------------------------------------------------------------
  54. libinput and Wayland
  55. ------------------------------------------------------------------------------
  56. libinput is not used directly by Wayland applications, it is an input stack
  57. used by the compositor. The typical software stack for a system running
  58. Wayland is:
  59. .. graphviz:: libinput-stack-wayland.gv
  60. The Wayland compositor may be Weston, mutter, KWin, etc. Note that
  61. Wayland encourages the use of toolkits, so the Wayland client (your
  62. application) does not usually talk directly to the compositor but rather
  63. employs a toolkit (e.g. GTK) to do so. The Wayland client does not know
  64. whether libinput is in use.
  65. libinput is not a requirement for Wayland or even a Wayland compositor.
  66. There are some specialized compositors that do not need or want libinput.
  67. .. _libinput-xorg:
  68. ------------------------------------------------------------------------------
  69. libinput and X.Org
  70. ------------------------------------------------------------------------------
  71. libinput is not used directly by X applications but rather through the
  72. custom xf86-input-libinput driver. The simplified software stack for a
  73. system running X.Org is:
  74. .. graphviz:: libinput-stack-xorg.gv
  75. libinput is not employed directly by the X server but by the
  76. xf86-input-libinput driver instead. That driver is loaded by the server
  77. on demand, depending on the xorg.conf.d configuration snippets. The X client
  78. does not know whether libinput is in use.
  79. libinput and xf86-input-libinput are not a requirement, the driver will only
  80. handle those devices explicitly assigned through an xorg.conf.d snippets. It
  81. is possible to mix xf86-input-libinput with other X.Org drivers.
  82. ------------------------------------------------------------------------------
  83. Device types
  84. ------------------------------------------------------------------------------
  85. libinput handles all common devices used to interact with a desktop system.
  86. This includes mice, keyboards, touchscreens, touchpads and graphics tablets.
  87. libinput does not expose the device type to the caller, it solely provides
  88. capabilities and the attached features (see
  89. `this blog post <https://who-t.blogspot.com/2015/06/libinput-and-lack-of-device-types.html>`_).
  90. For example, a touchpad in libinput is a device that provides pointer
  91. events, gestures and has a number of :ref:`config_options` such as
  92. :ref:`tapping`. A caller may present the device as touchpad to the user, or
  93. simply as device with a config knob to enable or disable tapping.
  94. ..............................................................................
  95. Handled device types
  96. ..............................................................................
  97. - :ref:`Touchpads`
  98. - Touchscreens
  99. - Mice
  100. - Keyboards
  101. - Virtual absolute pointing devices such as those used by QEMU or VirtualBox
  102. - Switches (Lid Switch, Tablet Mode switch, and Keypad Slide switch)
  103. - Graphics tablets
  104. - :ref:`Trackpoints`
  105. If a device falls into one of the above categories but does not work as
  106. expected, please :ref:`file a bug <reporting_bugs>`.
  107. ..............................................................................
  108. Unhandled device types
  109. ..............................................................................
  110. libinput does not handle some devices. The primary reason is that these
  111. device have no clear interaction with a desktop environment.
  112. Joysticks:
  113. Joysticks have one or more axes and one or more buttons. Beyond that it is
  114. difficult to find common ground between joysticks and much of the
  115. interaction is application-specific, not system-specific. libinput does not
  116. provide support for joysticks for that reason, any abstraction libinput
  117. would provide for joysticks would be so generic that libinput would
  118. merely introduce complexity and processing delays for no real benefit.