tablet-support.rst 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558
  1. .. _tablet-support:
  2. ==============================================================================
  3. Tablet support
  4. ==============================================================================
  5. This page provides details about the graphics tablet
  6. support in libinput. Note that the term "tablet" in libinput refers to
  7. graphics tablets only (e.g. Wacom Intuos), not to tablet devices like the
  8. Apple iPad.
  9. .. figure:: tablet.svg
  10. :align: center
  11. Illustration of a graphics tablet
  12. .. _tablet-tools:
  13. ------------------------------------------------------------------------------
  14. Pad buttons vs. tablet tools
  15. ------------------------------------------------------------------------------
  16. Most tablets provide two types of devices. The physical tablet often
  17. provides a number of buttons and a touch ring or strip. Interaction on the
  18. drawing surface of the tablet requires a tool, usually in the shape of a
  19. stylus. The libinput interface exposed by devices with the
  20. **LIBINPUT_DEVICE_CAP_TABLET_TOOL** capability applies only to events generated
  21. by tools.
  22. Buttons, rings or strips on the physical tablet hardware (the "pad") are
  23. exposed by devices with the **LIBINPUT_DEVICE_CAP_TABLET_PAD** capability.
  24. Pad events do not require a tool to be in proximity. Note that both
  25. capabilities may exist on the same device though usually they are split
  26. across multiple kernel devices.
  27. .. figure:: tablet-interfaces.svg
  28. :align: center
  29. Difference between Pad and Tool buttons
  30. Touch events on the tablet integrated into a screen itself are exposed
  31. through the **LIBINPUT_DEVICE_CAP_TOUCH** capability. Touch events on a
  32. standalone tablet are exposed through the **LIBINPUT_DEVICE_CAP_POINTER**
  33. capability. In both cases, the kernel usually provides a separate event
  34. node for the touch device, resulting in a separate libinput device.
  35. See **libinput_device_get_device_group()** for information on how to associate
  36. the touch part with other devices exposed by the same physical hardware.
  37. .. _tablet-tip:
  38. ------------------------------------------------------------------------------
  39. Tool tip events vs. tool button events
  40. ------------------------------------------------------------------------------
  41. The primary use of a tablet tool is to draw on the surface of the tablet.
  42. When the tool tip comes into contact with the surface, libinput sends an
  43. event of type **LIBINPUT_EVENT_TABLET_TOOL_TIP**, and again when the tip
  44. ceases contact with the surface.
  45. Tablet tools may send button events; these are exclusively for extra buttons
  46. unrelated to the tip. A button event is independent of the tip and can occur while
  47. the tip is down or up.
  48. Some tablet tools' pressure detection is too sensitive, causing phantom
  49. touches when the user only slightly brushes the surfaces. For example, some
  50. tools are capable of detecting 1 gram of pressure.
  51. libinput uses a device-specific pressure threshold to determine when the tip
  52. is considered logically down. As a result, libinput may send a nonzero
  53. pressure value while the tip is logically up. Most applications can and
  54. should ignore pressure information until they receive the event of type
  55. **LIBINPUT_EVENT_TABLET_TOOL_TIP**. Applications that require extremely
  56. fine-grained pressure sensitivity should use the pressure data instead of
  57. the tip events to determine a logical tip down state and treat the tip
  58. events like axis events otherwise.
  59. Note that the pressure threshold to trigger a logical tip event may be zero
  60. on some devices. On tools without pressure sensitivity, determining when a
  61. tip is down is device-specific.
  62. .. _tablet-relative-motion:
  63. ------------------------------------------------------------------------------
  64. Relative motion for tablet tools
  65. ------------------------------------------------------------------------------
  66. libinput calculates the relative motion vector for each event and converts
  67. it to the same coordinate space that a normal mouse device would use. For
  68. the caller, this means that the delta coordinates returned by
  69. **libinput_event_tablet_tool_get_dx()** and
  70. **libinput_event_tablet_tool_get_dy()** can be used identical to the delta
  71. coordinates from any other pointer event. Any resolution differences between
  72. the x and y axes are accommodated for, a delta of N/N represents a 45 degree
  73. diagonal move on the tablet.
  74. The delta coordinates are available for all tablet events, it is up to the
  75. caller to decide when a tool should be used in relative mode. It is
  76. recommended that mouse and lens cursor tool default to relative mode and
  77. all pen-like tools to absolute mode.
  78. If a tool in relative mode must not use pointer acceleration, callers
  79. should use the absolute coordinates returned by
  80. **libinput_event_tablet_tool_get_x()** and **libinput_event_tablet_tool_get_y()**
  81. and calculate the delta themselves. Callers that require exact physical
  82. distance should also use these functions to calculate delta movements.
  83. .. _tablet-axes:
  84. ------------------------------------------------------------------------------
  85. Special axes on tablet tools
  86. ------------------------------------------------------------------------------
  87. A tablet tool usually provides additional information beyond x/y positional
  88. information and the tip state. A tool may provide the distance to the tablet
  89. surface and the pressure exerted on the tip when in contact. Some tablets
  90. additionally provide tilt information along the x and y axis.
  91. .. figure:: tablet-axes.svg
  92. :align: center
  93. Illustration of the distance, pressure and tilt axes
  94. The granularity and precision of the distance and pressure axes varies
  95. between tablet devices and cannot usually be mapped into a physical unit.
  96. libinput normalizes distance and pressure into the [0, 1] range.
  97. While the normalization range is identical for these axes, a caller should
  98. not interpret identical values as identical across axes, i.e. a value v1 on
  99. the distance axis has no relation to the same value v1 on the pressure axis.
  100. The tilt axes provide the angle in degrees between a vertical line out of
  101. the tablet and the top of the stylus. The angle is measured along the x and
  102. y axis, respectively, a positive tilt angle thus means that the stylus' top
  103. is tilted towards the logical right and/or bottom of the tablet.
  104. .. _tablet-fake-proximity:
  105. ------------------------------------------------------------------------------
  106. Handling of proximity events
  107. ------------------------------------------------------------------------------
  108. libinput's **LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY** events notify a caller
  109. when a tool comes into sensor range or leaves the sensor range. On some
  110. tools this range does not represent the physical range but a reduced
  111. tool-specific logical range. If the range is reduced, this is done
  112. transparent to the caller.
  113. For example, the Wacom mouse and lens cursor tools are usually
  114. used in relative mode, lying flat on the tablet. Movement typically follows
  115. the interaction normal mouse movements have, i.e. slightly lift the tool and
  116. place it in a separate location. The proximity detection on Wacom
  117. tablets however extends further than the user may lift the mouse, i.e. the
  118. tool may not be lifted out of physical proximity. For such tools, libinput
  119. provides software-emulated proximity.
  120. Events from the pad do not require proximity, they may be sent any time.
  121. .. _tablet-pressure-offset:
  122. ------------------------------------------------------------------------------
  123. Pressure offset on worn-out tools
  124. ------------------------------------------------------------------------------
  125. When a tool is used for an extended period it can wear down physically. A
  126. worn-down tool may never return a zero pressure value. Even when hovering
  127. above the surface, the pressure value returned by the tool is nonzero,
  128. creating a fake surface touch and making interaction with the tablet less
  129. predictable.
  130. libinput automatically detects pressure offsets and rescales the remaining
  131. pressure range into the available range, making pressure-offsets transparent
  132. to the caller. A tool with a pressure offset will thus send a 0 pressure
  133. value for the detected offset and nonzero pressure values for values higher
  134. than that offset.
  135. Some limitations apply to avoid misdetection of pressure offsets,
  136. specifically:
  137. - pressure offset is only detected on proximity in, and if a device is
  138. capable of detection distances,
  139. - pressure offset is only detected if the distance between the tool and the
  140. tablet is high enough,
  141. - pressure offset is only used if it is 50% or less of the pressure range
  142. available to the tool. A pressure offset higher than 50% indicates either
  143. a misdetection or a tool that should be replaced, and
  144. - if a pressure value less than the current pressure offset is seen, the
  145. offset resets to that value.
  146. Pressure offsets are not detected on **LIBINPUT_TABLET_TOOL_TYPE_MOUSE**
  147. and **LIBINPUT_TABLET_TOOL_TYPE_LENS** tools.
  148. .. _tablet-pressure-range:
  149. ------------------------------------------------------------------------------
  150. Custom tablet tool pressure ranges
  151. ------------------------------------------------------------------------------
  152. On tablets supporting pressure, libinput provides that hardware pressure as
  153. a logical range of ``0.0`` up to ``1.0`` for the maximum supported pressure.
  154. By default, the hardware range thus maps into the following logical range::
  155. hw minimum hw maximum
  156. hw range: |------|-----------------------------------|
  157. logical range: |----|-----------------------------------|
  158. 0.0 | 1.0
  159. Tip
  160. Note that libinput always has some built-in thresholds to filter out erroneous
  161. touches with near-zero pressure but otherwise the hardware range maps as-is
  162. into the logical range. The :ref:`tip event <tablet-tip>` threshold is defined
  163. within this range.
  164. For some use-cases the full hardware range is not suitable, it may require either
  165. too light a pressure for the user to interact or it may require too hard a
  166. pressure before the logical maximum is reached. libinput provides
  167. the **libinput_tablet_tool_config_pressure_range_set()** function that allows
  168. reducing the usable range of the tablet::
  169. hw minimum hw maximum
  170. hw range: |----------|-------------------------------|
  171. adjusted range: |------|---------------------|
  172. logical range: |----|---------------------|
  173. 0.0 | 1.0
  174. Tip
  175. A reduced range as shown above will result in
  176. - all hw pressure below the new minimum to register as logical pressure ``0.0``
  177. - all hw pressure above the new maximum to register as logical pressure ``1.0``
  178. - the tip event threshold to be relative to the new minimum
  179. In other words, adjusting the pressure range of a tablet tool is equivalent to
  180. reducing the hardware range of said tool. Note that where a custom pressure
  181. range is set, detection of :ref:`tablet-pressure-offset` is disabled.
  182. .. _tablet-serial-numbers:
  183. ------------------------------------------------------------------------------
  184. Tracking unique tools
  185. ------------------------------------------------------------------------------
  186. Some tools provide hardware information that enables libinput to uniquely
  187. identify the physical device. For example, tools compatible with the Wacom
  188. Intuos 4, Intuos 5, Intuos Pro and Cintiq series are uniquely identifiable
  189. through a serial number. libinput does not specify how a tool can be
  190. identified uniquely, a caller should use **libinput_tablet_tool_is_unique()** to
  191. check if the tool is unique.
  192. libinput creates a struct libinput_tablet_tool on the first proximity in of
  193. this tool. By default, this struct is destroyed on proximity out and
  194. re-initialized on the next proximity in. If a caller keeps a reference to
  195. the tool by using **libinput_tablet_tool_ref()** libinput re-uses this struct
  196. whenever that same physical tool comes into proximity on any tablet
  197. recognized by libinput. It is possible to attach tool-specific virtual state
  198. to the tool. For example, a graphics program such as the GIMP may assign a
  199. specific color to each tool, allowing the artist to use the tools like
  200. physical pens of different color. In multi-tablet setups it is also
  201. possible to track the tool across devices.
  202. If the tool does not have a unique identifier, libinput creates a single
  203. struct libinput_tablet_tool per tool type on each tablet the tool is used
  204. on.
  205. .. _tablet-tool-types:
  206. ------------------------------------------------------------------------------
  207. Vendor-specific tablet tool types
  208. ------------------------------------------------------------------------------
  209. libinput supports a number of high-level tool types that describe the
  210. general interaction expected with the tool. For example, a user would expect
  211. a tool of type **LIBINPUT_TABLET_TOOL_TYPE_PEN** to interact with a
  212. graphics application taking pressure and tilt into account. The default
  213. virtual tool assigned should be a drawing tool, e.g. a virtual pen or brush.
  214. A tool of type **LIBINPUT_TABLET_TOOL_TYPE_ERASER** would normally be
  215. mapped to an eraser-like virtual tool. See **libinput_tablet_tool_type**
  216. for the list of all available tools.
  217. Vendors may provide more fine-grained information about the tool in use by
  218. adding a hardware-specific tool ID. libinput provides this ID to the caller
  219. with **libinput_tablet_tool_get_tool_id()** but makes no promises about the
  220. content or format of the ID.
  221. libinput currently supports Wacom-style tool IDs as provided on the Wacom
  222. Intuos 3, 4, 5, Wacom Cintiq and Wacom Intuos Pro series. The tool ID can
  223. be used to distinguish between e.g. a Wacom Classic Pen or a Wacom Pro Pen.
  224. It is the caller's responsibility to interpret the tool ID.
  225. .. _tablet-bounds:
  226. ------------------------------------------------------------------------------
  227. Out-of-bounds motion events
  228. ------------------------------------------------------------------------------
  229. Some tablets integrated into a screen (e.g. Wacom Cintiq 24HD, 27QHD and
  230. 13HD series, etc.) have a sensor larger than the display area. libinput uses
  231. the range advertised by the kernel as the valid range unless device-specific
  232. quirks are present. Events outside this range will produce coordinates that
  233. may be negative or larger than the tablet's width and/or height. It is up to
  234. the caller to ignore these events.
  235. .. figure:: tablet-out-of-bounds.svg
  236. :align: center
  237. Illustration of the out-of-bounds area on a tablet
  238. In the image above, the display area is shown in black. The red area around
  239. the display illustrates the sensor area that generates input events. Events
  240. within this area will have negative coordinate or coordinates larger than
  241. the width/height of the tablet.
  242. If events outside the logical bounds of the input area are scaled into a
  243. custom range with **libinput_event_tablet_tool_get_x_transformed()** and
  244. **libinput_event_tablet_tool_get_y_transformed()** the resulting value may be
  245. less than 0 or larger than the upper range provided. It is up to the caller
  246. to test for this and handle or ignore these events accordingly.
  247. .. _tablet-pad-buttons:
  248. ------------------------------------------------------------------------------
  249. Tablet pad button numbers
  250. ------------------------------------------------------------------------------
  251. Tablet Pad buttons are numbered sequentially, starting with button 0. Thus
  252. button numbers returned by **libinput_event_tablet_pad_get_button_number()**
  253. have no semantic meaning, a notable difference to the button codes returned
  254. by other libinput interfaces (e.g. **libinput_event_tablet_tool_get_button()**).
  255. The Linux kernel requires all input events to have semantic event codes,
  256. but generic buttons like those on a pad cannot easily be assigned semantic
  257. codes. The kernel supports generic codes in the form of BTN_0 through to
  258. BTN_9 and additional unnamed space up until code 0x10f. Additional generic
  259. buttons are available as BTN_A in the range dedicated for gamepads and
  260. joysticks. Thus, tablet with a large number of buttons have to map across
  261. two semantic ranges, have to use unnamed kernel button codes or risk leaking
  262. into an unrelated range. libinput transparently maps the kernel event codes
  263. into a sequential button range on the pad. Callers should use external
  264. sources like libwacom to associate button numbers to their position on the
  265. tablet.
  266. Some buttons may have expected default behaviors. For example, on Wacom
  267. Intuos Pro series tablets, the button inside the touch ring is expected to
  268. switch between modes, see :ref:`tablet-pad-modes`. Callers should use
  269. external sources like libwacom to identify which buttons have semantic
  270. behaviors.
  271. .. _tablet-left-handed:
  272. ------------------------------------------------------------------------------
  273. Tablets in left-handed mode
  274. ------------------------------------------------------------------------------
  275. Left-handed mode on tablet devices usually means rotating the physical
  276. tablet by 180 degrees to move the tablet pad button area to right side of
  277. the tablet. When left-handed mode is enabled on a tablet device (see
  278. **libinput_device_config_left_handed_set()**) the tablet tool and tablet pad
  279. behavior changes. In left-handed mode, the tools' axes are adjusted
  280. so that the origin of each axis remains the logical north-west of
  281. the physical tablet. For example, the x and y axes are inverted and the
  282. positive x/y coordinates are down/right of the top-left corner of the tablet
  283. in its current orientation. On a tablet pad, the ring and strip are
  284. similarly adjusted. The origin of the ring and strips remain the top-most
  285. point.
  286. .. figure:: tablet-left-handed.svg
  287. :align: center
  288. Tablet axes in right- and left-handed mode
  289. Pad buttons are not affected by left-handed mode; the number of each button
  290. remains the same even when the perceived physical location of the button
  291. changes. This is a conscious design decision:
  292. - Tablet pad buttons do not have intrinsic semantic meanings. Re-ordering
  293. the button numbers would not change any functionality.
  294. - Button numbers should not be exposed directly to the user but handled in
  295. the intermediate layers. Re-ordering button numbers thus has no
  296. user-visible effect.
  297. - Re-ordering button numbers may complicate the intermediate layers.
  298. Left-handed mode is only available on some tablets, some tablets are
  299. symmetric and thus do not support left-handed mode. libinput requires
  300. libwacom to determine if a tablet is capable of being switched to
  301. left-handed mode.
  302. .. _tablet-pad-modes:
  303. ------------------------------------------------------------------------------
  304. Tablet pad modes
  305. ------------------------------------------------------------------------------
  306. Tablet pad modes are virtual groupings of button, ring and strip
  307. functionality. A caller may assign different functionalities depending on
  308. the mode the tablet is in. For example, in mode 0 the touch ring may emulate
  309. scrolling, in mode 1 the touch ring may emulate zooming, etc. libinput
  310. handles the modes and mode switching but does not assign specific
  311. functionality to buttons, rings or strips based on the mode. It is up to the
  312. caller to decide whether the mode only applies to buttons, rings and strips
  313. or only to rings and strips (this is the case with the Wacom OS X and
  314. Windows driver).
  315. The availability of modes on a tablet pad usually depends on visual feedback
  316. such as LEDs around the touch ring. If no visual feedback is available, only
  317. one mode may be available.
  318. Mode switching is controlled by libinput and usually toggled by one or
  319. more buttons on the device. For example, on the Wacom Intuos 4, 5, and
  320. Pro series tablets the mode button is the button centered in the touch
  321. ring and toggles the modes sequentially. On the Wacom Cintiq 24HD the
  322. three buttons next to each touch ring allow for directly changing the
  323. mode to the desired setting.
  324. Multiple modes may exist on the tablet, libinput uses the term "mode group"
  325. for such groupings of buttons that share a mode and mode toggle. For
  326. example, the Wacom Cintiq 24HD has two separate mode groups, one for the
  327. left set of buttons, strips, and touch rings and one for the right set.
  328. libinput handles the mode groups independently and returns the mode for each
  329. button as appropriate. The mode group is static for the lifetime of the
  330. device.
  331. .. figure:: tablet-intuos-modes.svg
  332. :align: center
  333. Modes on an Intuos Pro-like tablet
  334. In the image above, the Intuos Pro-like tablet provides 4 LEDs to indicate
  335. the currently active modes. The button inside the touch ring cycles through
  336. the modes in a clockwise fashion. The upper-right LED indicates that the
  337. currently active mode is 1, based on 0-indexed mode numbering.
  338. **libinput_event_tablet_pad_get_mode()** would thus return 1 for all button and
  339. ring events on this tablet. When the center button is pressed, the mode
  340. switches to mode 2, the LED changes to the bottom-right and
  341. **libinput_event_tablet_pad_get_mode()** returns 2 for the center button event
  342. and all subsequent events.
  343. .. figure:: tablet-cintiq24hd-modes.svg
  344. :align: center
  345. Modes on an Cintiq 24HD-like tablet
  346. In the image above, the Cintiq 24HD-like tablet provides 3 LEDs on each side
  347. of the tablet to indicate the currently active mode for that group of
  348. buttons and the respective ring. The buttons next to the touch ring select
  349. the mode directly. The two LEDs indicate that the mode for the left set of
  350. buttons is currently 0, the mode for the right set of buttons is currently
  351. 1, based on 0-indexed mode numbering. **libinput_event_tablet_pad_get_mode()**
  352. would thus return 0 for all button and ring events on the left and 1 for all
  353. button and ring events on the right. When one of the three mode toggle
  354. buttons on the right is pressed, the right mode switches to that button's
  355. mode but the left mode remains unchanged.
  356. .. _tablet-touch-arbitration:
  357. ------------------------------------------------------------------------------
  358. Tablet touch arbitration
  359. ------------------------------------------------------------------------------
  360. "Touch arbitration" is the terminology used when touch events are suppressed
  361. while the pen is in proximity. Since it is almost impossible to use a stylus
  362. or other tool without triggering touches with the hand holding the tool,
  363. touch arbitration serves to reduce the number of accidental inputs.
  364. The wacom kernel driver currently provides touch arbitration but for other
  365. devices arbitration has to be done in userspace.
  366. libinput uses the **libinput_device_group** to decide on touch arbitration
  367. and automatically discards touch events whenever a tool is in proximity.
  368. The exact behavior is device-dependent but typically comes in two forms: full
  369. tablet touch arbitration and partial arbitration.
  370. .. figure:: tablet-touch-arbitration.svg
  371. :align: center
  372. Partial touch arbitration during a pen interaction for left-handed
  373. and right-handed pen tilt.
  374. Full arbitration simply disables touch on the device while the pen is in
  375. proximity. Partial touch arbitration disables the side of the tablet around the
  376. user's hand, starting slightly to the side of the pen tip. If the pen tilts
  377. to the left (pen held in the left hand), the rectangle is to the left of the
  378. pen tip, if the pen tilts to the right (pen held in the right hand) it is to
  379. the right of the pen tip.
  380. .. _tablet-area:
  381. ------------------------------------------------------------------------------
  382. Tablet area
  383. ------------------------------------------------------------------------------
  384. External tablet devices such as e.g. the Wacom Intuos series can be configured
  385. to reduce the available logical input area. Typically the logical input area
  386. is equivalent to the physical input area but it can be reduced with the
  387. **libinput_device_config_area_set_rectangle()** call. Once reduced, input
  388. events outside the logical input area are ignored and the logical input area
  389. acts as if it represented the extents of the physical tablet.
  390. .. figure:: tablet-area.svg
  391. :align: center
  392. Tablet area configuration example
  393. In the image above, the area is set to the rectangle 0.25/0.25 to 0.5/0.75.
  394. Even though the tool is roughly at the physical position ``0.5 * width`` and
  395. ``0.75 * height``, the return values of
  396. **libinput_event_tablet_tool_get_x_transformed()** and
  397. **libinput_event_tablet_tool_get_y_transformed()** would be close to the
  398. maximum provided in this call.
  399. The size of the tablet reported by **libinput_device_get_size()** always reflects
  400. the physical area, not the logical area.
  401. .. _tablet-eraser-button:
  402. ------------------------------------------------------------------------------
  403. Tablet eraser buttons
  404. ------------------------------------------------------------------------------
  405. Tablet tools come in a variety of forms but the most common one is a
  406. pen-like tool. Some of these pen-like tools have a virtual eraser at the
  407. tip of the tool - inverting the tool brings the eraser into proximity.
  408. .. figure:: tablet-eraser-invert.svg
  409. :align: center
  410. A pen-like tool used as pen and as eraser by inverting it
  411. Having an eraser as a separate tool is beneficial in many applications as the
  412. eraser tool can be assigned different functionality (colors, paint tools, etc.)
  413. that is easily available.
  414. However, a large proportion of tablet pens have an "eraser button". By
  415. pressing the button the pen switches to be an eraser tool.
  416. On the data level this is not done via a button event, instead the firmware
  417. will pretend the pen tool going out of proximity and the eraser coming
  418. into proximity immediately after - as if the tool was physically inverted.
  419. .. figure:: tablet-eraser-button.svg
  420. :align: center
  421. A pen-like tool used as pen and as eraser by pressing the eraser button
  422. Microsoft mandates this behavior (see
  423. `Windows Pen States <https://learn.microsoft.com/en-us/windows-hardware/design/component-guidelines/windows-pen-states>`_
  424. for details) and thus the overwhelming majority of devices will have
  425. an eraser button that virtually inverts the pen.
  426. Enforcing an eraser button means that users have one button less on the
  427. stylus that they would have otherwise. For some users the eraser button
  428. is in an inconvenient location, others don't want an eraser button at all.
  429. libinput provides an eraser button configuration that allows disabling the
  430. eraser button and turning it into a normal button event. If the eraser button
  431. is disabled, pressing that button will generate a normal tablet tool button
  432. event.
  433. This configuration is only available on pens with an eraser button, not on
  434. pens with an invert-type eraser.