libinput: Device configuration

Enumerations | Functions
Device configuration

Enable, disable, change and/or check for device-specific features. More...

## Enumerations
enum | libinput_config_status { LIBINPUT_CONFIG_STATUS_SUCCESS, LIBINPUT_CONFIG_STATUS_UNSUPPORTED, LIBINPUT_CONFIG_STATUS_INVALID }
| Status codes returned when applying configuration settings. More...
enum | libinput_config_tap_state { LIBINPUT_CONFIG_TAP_DISABLED, LIBINPUT_CONFIG_TAP_ENABLED }
enum | libinput_config_tap_button_map { LIBINPUT_CONFIG_TAP_MAP_LRM, LIBINPUT_CONFIG_TAP_MAP_LMR }
enum | libinput_config_drag_state { LIBINPUT_CONFIG_DRAG_DISABLED, LIBINPUT_CONFIG_DRAG_ENABLED }
| A config status to distinguish or set dragging on a device. More...
enum | libinput_config_drag_lock_state { LIBINPUT_CONFIG_DRAG_LOCK_DISABLED, LIBINPUT_CONFIG_DRAG_LOCK_ENABLED }
enum | libinput_config_send_events_mode { LIBINPUT_CONFIG_SEND_EVENTS_ENABLED, LIBINPUT_CONFIG_SEND_EVENTS_DISABLED, LIBINPUT_CONFIG_SEND_EVENTS_DISABLED_ON_EXTERNAL_MOUSE }
| The send-event mode of a device defines when a device may generate events and pass those events to the caller. More...
enum | libinput_config_accel_profile { LIBINPUT_CONFIG_ACCEL_PROFILE_NONE, LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT, LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE }
enum | libinput_config_click_method { LIBINPUT_CONFIG_CLICK_METHOD_NONE, LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS, LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER }
| The click method defines when to generate software-emulated buttons, usually on a device that does not have a specific physical button available. More...
enum | libinput_config_middle_emulation_state { LIBINPUT_CONFIG_MIDDLE_EMULATION_DISABLED, LIBINPUT_CONFIG_MIDDLE_EMULATION_ENABLED }
enum | libinput_config_scroll_method { LIBINPUT_CONFIG_SCROLL_NO_SCROLL, LIBINPUT_CONFIG_SCROLL_2FG, LIBINPUT_CONFIG_SCROLL_EDGE, LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN }
| The scroll method of a device selects when to generate scroll axis events instead of pointer motion events. More...
enum | libinput_config_dwt_state { LIBINPUT_CONFIG_DWT_DISABLED, LIBINPUT_CONFIG_DWT_ENABLED }
| Possible states for the disable-while-typing feature. More...

## Functions
const char * | libinput_config_status_to_str (enum libinput_config_status status)
| Return a string describing the error. More...
int | libinput_device_config_tap_get_finger_count (struct libinput_device *device)
| Check if the device supports tap-to-click and how many fingers can be used for tapping. More...
enum libinput_config_status | libinput_device_config_tap_set_enabled (struct libinput_device *device, enum libinput_config_tap_state enable)
| Enable or disable tap-to-click on this device, with a default mapping of 1, 2, 3 finger tap mapping to left, right, middle click, respectively. More...
enum libinput_config_tap_state | libinput_device_config_tap_get_enabled (struct libinput_device *device)
| Check if tap-to-click is enabled on this device. More...
enum libinput_config_tap_state | libinput_device_config_tap_get_default_enabled (struct libinput_device *device)
| Return the default setting for whether tap-to-click is enabled on this device. More...
enum libinput_config_status | libinput_device_config_tap_set_button_map (struct libinput_device *device, enum libinput_config_tap_button_map map)
| Set the finger number to button number mapping for tap-to-click. More...
enum libinput_config_tap_button_map | libinput_device_config_tap_get_button_map (struct libinput_device *device)
| Get the finger number to button number mapping for tap-to-click. More...
enum libinput_config_tap_button_map | libinput_device_config_tap_get_default_button_map (struct libinput_device *device)
| Get the default finger number to button number mapping for tap-to-click. More...
enum libinput_config_status | libinput_device_config_tap_set_drag_enabled (struct libinput_device *device, enum libinput_config_drag_state enable)
| Enable or disable tap-and-drag on this device. More...
enum libinput_config_drag_state | libinput_device_config_tap_get_drag_enabled (struct libinput_device *device)
| Return whether tap-and-drag is enabled or disabled on this device. More...
enum libinput_config_drag_state | libinput_device_config_tap_get_default_drag_enabled (struct libinput_device *device)
| Return whether tap-and-drag is enabled or disabled by default on this device. More...
enum libinput_config_status | libinput_device_config_tap_set_drag_lock_enabled (struct libinput_device *device, enum libinput_config_drag_lock_state enable)
| Enable or disable drag-lock during tapping on this device. More...
enum libinput_config_drag_lock_state | libinput_device_config_tap_get_drag_lock_enabled (struct libinput_device *device)
| Check if drag-lock during tapping is enabled on this device. More...
enum libinput_config_drag_lock_state | libinput_device_config_tap_get_default_drag_lock_enabled (struct libinput_device *device)
| Check if drag-lock during tapping is enabled by default on this device. More...
int | libinput_device_config_calibration_has_matrix (struct libinput_device *device)
| Check if the device can be calibrated via a calibration matrix. More...
enum libinput_config_status | libinput_device_config_calibration_set_matrix (struct libinput_device *device, const float matrix[6])
| Apply the 3x3 transformation matrix to absolute device coordinates. More...
int | libinput_device_config_calibration_get_matrix (struct libinput_device *device, float matrix[6])
| Return the current calibration matrix for this device. More...
int | libinput_device_config_calibration_get_default_matrix (struct libinput_device *device, float matrix[6])
| Return the default calibration matrix for this device. More...
uint32_t | libinput_device_config_send_events_get_modes (struct libinput_device *device)
| Return the possible send-event modes for this device. More...
enum libinput_config_status | libinput_device_config_send_events_set_mode (struct libinput_device *device, uint32_t mode)
| Set the send-event mode for this device. More...
uint32_t | libinput_device_config_send_events_get_mode (struct libinput_device *device)
| Get the send-event mode for this device. More...
uint32_t | libinput_device_config_send_events_get_default_mode (struct libinput_device *device)
| Get the default send-event mode for this device. More...
int | libinput_device_config_accel_is_available (struct libinput_device *device)
| Check if a device uses libinput-internal pointer-acceleration. More...
enum libinput_config_status | libinput_device_config_accel_set_speed (struct libinput_device *device, double speed)
| Set the pointer acceleration speed of this pointer device within a range of [-1, 1], where 0 is the default acceleration for this device, -1 is the slowest acceleration and 1 is the maximum acceleration available on this device. More...
double | libinput_device_config_accel_get_speed (struct libinput_device *device)
| Get the current pointer acceleration setting for this pointer device. More...
double | libinput_device_config_accel_get_default_speed (struct libinput_device *device)
| Return the default speed setting for this device, normalized to a range of [-1, 1]. More...
uint32_t | libinput_device_config_accel_get_profiles (struct libinput_device *device)
| Returns a bitmask of the configurable acceleration modes available on this device. More...
enum libinput_config_status | libinput_device_config_accel_set_profile (struct libinput_device *device, enum libinput_config_accel_profile mode)
| Set the pointer acceleration profile of this pointer device to the given mode. More...
enum libinput_config_accel_profile | libinput_device_config_accel_get_profile (struct libinput_device *device)
| Get the current pointer acceleration profile for this pointer device. More...
enum libinput_config_accel_profile | libinput_device_config_accel_get_default_profile (struct libinput_device *device)
| Return the default pointer acceleration profile for this pointer device. More...
int | libinput_device_config_scroll_has_natural_scroll (struct libinput_device *device)
| Return non-zero if the device supports "natural scrolling". More...
enum libinput_config_status | libinput_device_config_scroll_set_natural_scroll_enabled (struct libinput_device *device, int enable)
| Enable or disable natural scrolling on the device. More...
int | libinput_device_config_scroll_get_natural_scroll_enabled (struct libinput_device *device)
| Get the current mode for scrolling on this device. More...
int | libinput_device_config_scroll_get_default_natural_scroll_enabled (struct libinput_device *device)
| Get the default mode for scrolling on this device. More...
int | libinput_device_config_left_handed_is_available (struct libinput_device *device)
| Check if a device has a configuration that supports left-handed usage. More...
enum libinput_config_status | libinput_device_config_left_handed_set (struct libinput_device *device, int left_handed)
| Set the left-handed configuration of the device. More...
int | libinput_device_config_left_handed_get (struct libinput_device *device)
| Get the current left-handed configuration of the device. More...
int | libinput_device_config_left_handed_get_default (struct libinput_device *device)
| Get the default left-handed configuration of the device. More...
uint32_t | libinput_device_config_click_get_methods (struct libinput_device *device)
| Check which button click methods a device supports. More...
enum libinput_config_status | libinput_device_config_click_set_method (struct libinput_device *device, enum libinput_config_click_method method)
| Set the button click method for this device. More...
enum libinput_config_click_method | libinput_device_config_click_get_method (struct libinput_device *device)
| Get the button click method for this device. More...
enum libinput_config_click_method | libinput_device_config_click_get_default_method (struct libinput_device *device)
| Get the default button click method for this device. More...
int | libinput_device_config_middle_emulation_is_available (struct libinput_device *device)
| Check if middle mouse button emulation configuration is available on this device. More...
enum libinput_config_status | libinput_device_config_middle_emulation_set_enabled (struct libinput_device *device, enum libinput_config_middle_emulation_state enable)
| Enable or disable middle button emulation on this device. More...
enum libinput_config_middle_emulation_state | libinput_device_config_middle_emulation_get_enabled (struct libinput_device *device)
| Check if configurable middle button emulation is enabled on this device. More...
enum libinput_config_middle_emulation_state | libinput_device_config_middle_emulation_get_default_enabled (struct libinput_device *device)
| Check if configurable middle button emulation is enabled by default on this device. More...
uint32_t | libinput_device_config_scroll_get_methods (struct libinput_device *device)
| Check which scroll methods a device supports. More...
enum libinput_config_status | libinput_device_config_scroll_set_method (struct libinput_device *device, enum libinput_config_scroll_method method)
| Set the scroll method for this device. More...
enum libinput_config_scroll_method | libinput_device_config_scroll_get_method (struct libinput_device *device)
| Get the scroll method for this device. More...
enum libinput_config_scroll_method | libinput_device_config_scroll_get_default_method (struct libinput_device *device)
| Get the default scroll method for this device. More...
enum libinput_config_status | libinput_device_config_scroll_set_button (struct libinput_device *device, uint32_t button)
| Set the button for the LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN method for this device. More...
uint32_t | libinput_device_config_scroll_get_button (struct libinput_device *device)
| Get the button for the LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN method for this device. More...
uint32_t | libinput_device_config_scroll_get_default_button (struct libinput_device *device)
| Get the default button for the LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN method for this device. More...
int | libinput_device_config_dwt_is_available (struct libinput_device *device)
| Check if this device supports configurable disable-while-typing feature. More...
enum libinput_config_status | libinput_device_config_dwt_set_enabled (struct libinput_device *device, enum libinput_config_dwt_state enable)
| Enable or disable the disable-while-typing feature. More...
enum libinput_config_dwt_state | libinput_device_config_dwt_get_enabled (struct libinput_device *device)
| Check if the disable-while typing feature is currently enabled on this device. More...
enum libinput_config_dwt_state | libinput_device_config_dwt_get_default_enabled (struct libinput_device *device)
| Check if the disable-while typing feature is enabled on this device by default. More...
int | libinput_device_config_rotation_is_available (struct libinput_device *device)
| Check whether a device can have a custom rotation applied. More...
enum libinput_config_status | libinput_device_config_rotation_set_angle (struct libinput_device *device, unsigned int degrees_cw)
| Set the rotation of a device in degrees clockwise off the logical neutral position. More...
unsigned int | libinput_device_config_rotation_get_angle (struct libinput_device *device)
| Get the current rotation of a device in degrees clockwise off the logical neutral position. More...
unsigned int | libinput_device_config_rotation_get_default_angle (struct libinput_device *device)
| Get the default rotation of a device in degrees clockwise off the logical neutral position. More...

## Detailed Description

Enable, disable, change and/or check for device-specific features.

For all features, libinput assigns a default based on the hardware configuration. This default can be obtained with the respective get_default call.

Configuration options are device dependent and not all options are supported on all devices. For all configuration options, libinput provides a call to check if a configuration option is available on a device (e.g. libinput_device_config_calibration_has_matrix())

Some configuration option may be dependent on or mutually exclusive with with other options. The behavior in those cases is implementation-dependent, the caller must ensure that the options are set in the right order.

Below is a general grouping of configuration options according to device type. Note that this is a guide only and not indicative of any specific device.

- Touchpad:
  - libinput_device_config_tap_set_enabled()
  - libinput_device_config_tap_set_drag_enabled()
  - libinput_device_config_tap_set_drag_lock_enabled()
  - libinput_device_config_click_set_method()
  - libinput_device_config_scroll_set_method()
  - libinput_device_config_dwt_set_enabled()
- Touchscreens:
  - libinput_device_config_calibration_set_matrix()
- Pointer devices (mice, trackballs, touchpads):
  - libinput_device_config_accel_set_speed()
  - libinput_device_config_accel_set_profile()
  - libinput_device_config_scroll_set_natural_scroll_enabled()
  - libinput_device_config_left_handed_set()
  - libinput_device_config_middle_emulation_set_enabled()
  - libinput_device_config_rotation_set_angle()
- All devices:
  - libinput_device_config_send_events_set_mode()

## Enumeration Type Documentation

## ◆ libinput_config_accel_profile

enum libinput_config_accel_profile

Enumerator
LIBINPUT_CONFIG_ACCEL_PROFILE_NONE | Placeholder for devices that don't have a configurable pointer acceleration profile.
LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT | A flat acceleration profile. Pointer motion is accelerated by a constant (device-specific) factor, depending on the current speed. See also libinput_device_config_accel_set_speed
LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE | An adaptive acceleration profile. Pointer acceleration depends on the input speed. This is the default profile for most devices.

## ◆ libinput_config_click_method

enum libinput_config_click_method

The click method defines when to generate software-emulated buttons, usually on a device that does not have a specific physical button available.

Enumerator
LIBINPUT_CONFIG_CLICK_METHOD_NONE | Do not send software-emulated button events. This has no effect on events generated by physical buttons.
LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS | Use software-button areas (see Clickfinger behavior) to generate button events.
LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER | The number of fingers decides which button press to generate.

## ◆ libinput_config_drag_lock_state

enum libinput_config_drag_lock_state

Enumerator
LIBINPUT_CONFIG_DRAG_LOCK_DISABLED | Drag lock is to be disabled, or is currently disabled.
LIBINPUT_CONFIG_DRAG_LOCK_ENABLED | Drag lock is to be enabled, or is currently disabled.

## ◆ libinput_config_drag_state

enum libinput_config_drag_state

A config status to distinguish or set dragging on a device.

Currently implemented for tap-and-drag only, see libinput_device_config_tap_set_drag_enabled()

Enumerator
LIBINPUT_CONFIG_DRAG_DISABLED | Drag is to be disabled, or is currently disabled.
LIBINPUT_CONFIG_DRAG_ENABLED | Drag is to be enabled, or is currently enabled.

## ◆ libinput_config_dwt_state

enum libinput_config_dwt_state

Possible states for the disable-while-typing feature.

See Disable-while-typing for details.

Enumerator
LIBINPUT_CONFIG_DWT_DISABLED |
LIBINPUT_CONFIG_DWT_ENABLED |

## ◆ libinput_config_middle_emulation_state

enum libinput_config_middle_emulation_state

Enumerator
LIBINPUT_CONFIG_MIDDLE_EMULATION_DISABLED | Middle mouse button emulation is to be disabled, or is currently disabled.
LIBINPUT_CONFIG_MIDDLE_EMULATION_ENABLED | Middle mouse button emulation is to be enabled, or is currently enabled.

## ◆ libinput_config_scroll_method

enum libinput_config_scroll_method

The scroll method of a device selects when to generate scroll axis events instead of pointer motion events.

Enumerator
LIBINPUT_CONFIG_SCROLL_NO_SCROLL | Never send scroll events instead of pointer motion events. This has no effect on events generated by scroll wheels.
LIBINPUT_CONFIG_SCROLL_2FG | Send scroll events when two fingers are logically down on the device.
LIBINPUT_CONFIG_SCROLL_EDGE | Send scroll events when a finger moves along the bottom or right edge of a device.
LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN | Send scroll events when a button is down and the device moves along a scroll-capable axis.

## ◆ libinput_config_send_events_mode

enum libinput_config_send_events_mode

The send-event mode of a device defines when a device may generate events and pass those events to the caller.

Enumerator
LIBINPUT_CONFIG_SEND_EVENTS_ENABLED | Send events from this device normally. This is a placeholder mode only, any device detected by libinput can be enabled. Do not test for this value as bitmask.
LIBINPUT_CONFIG_SEND_EVENTS_DISABLED | Do not send events through this device. Depending on the device, this may close all file descriptors on the device or it may leave the file descriptors open and route events through a different device. If this bit field is set, other disable modes may be ignored. For example, if both LIBINPUT_CONFIG_SEND_EVENTS_DISABLED and LIBINPUT_CONFIG_SEND_EVENTS_DISABLED_ON_EXTERNAL_MOUSE are set, the device remains disabled when all external pointer devices are unplugged.
LIBINPUT_CONFIG_SEND_EVENTS_DISABLED_ON_EXTERNAL_MOUSE | If an external pointer device is plugged in, do not send events from this device. This option may be available on built-in touchpads.

## ◆ libinput_config_status

enum libinput_config_status

Status codes returned when applying configuration settings.

Enumerator
LIBINPUT_CONFIG_STATUS_SUCCESS | Config applied successfully.
LIBINPUT_CONFIG_STATUS_UNSUPPORTED | Configuration not available on this device.
LIBINPUT_CONFIG_STATUS_INVALID | Invalid parameter range.

## ◆ libinput_config_tap_button_map

enum libinput_config_tap_button_map

Enumerator
LIBINPUT_CONFIG_TAP_MAP_LRM | 1/2/3 finger tap maps to left/right/middle
LIBINPUT_CONFIG_TAP_MAP_LMR | 1/2/3 finger tap maps to left/middle/right

## ◆ libinput_config_tap_state

enum libinput_config_tap_state

Enumerator
LIBINPUT_CONFIG_TAP_DISABLED | Tapping is to be disabled, or is currently disabled.
LIBINPUT_CONFIG_TAP_ENABLED | Tapping is to be enabled, or is currently enabled.

## Function Documentation

## ◆ libinput_config_status_to_str()

const char* libinput_config_status_to_str | ( | enum libinput_config_status | status | ) |

Return a string describing the error.

Parameters

  status | The status to translate to a string

Returns
  A human-readable string representing the error or NULL for an invalid status.

## ◆ libinput_device_config_accel_get_default_profile()

enum libinput_config_accel_profile libinput_device_config_accel_get_default_profile | ( | struct libinput_device * | device | ) |

Return the default pointer acceleration profile for this pointer device.

Parameters

  device | The device to configure

Returns
  The default acceleration profile for this device.

## ◆ libinput_device_config_accel_get_default_speed()

double libinput_device_config_accel_get_default_speed | ( | struct libinput_device * | device | ) |

Return the default speed setting for this device, normalized to a range of [-1, 1].

See libinput_device_config_accel_set_speed() for details.

Parameters

  device | The device to configure

Returns
  The default speed setting for this device.

See also
  libinput_device_config_accel_is_available
  libinput_device_config_accel_set_speed
  libinput_device_config_accel_get_speed

## ◆ libinput_device_config_accel_get_profile()

enum libinput_config_accel_profile libinput_device_config_accel_get_profile | ( | struct libinput_device * | device | ) |

Get the current pointer acceleration profile for this pointer device.

Parameters

  device | The device to configure

Returns
  The currently configured pointer acceleration profile.

## ◆ libinput_device_config_accel_get_profiles()

uint32_t libinput_device_config_accel_get_profiles | ( | struct libinput_device * | device | ) |

Returns a bitmask of the configurable acceleration modes available on this device.

Parameters

  device | The device to configure

Returns
  A bitmask of all configurable modes available on this device.

## ◆ libinput_device_config_accel_get_speed()

double libinput_device_config_accel_get_speed | ( | struct libinput_device * | device | ) |

Get the current pointer acceleration setting for this pointer device.

The returned value is normalized to a range of [-1, 1]. See libinput_device_config_accel_set_speed() for details.

Parameters

  device | The device to configure

Returns
  The current speed, range -1 to 1

See also
  libinput_device_config_accel_is_available
  libinput_device_config_accel_set_speed
  libinput_device_config_accel_get_default_speed

## ◆ libinput_device_config_accel_is_available()

int libinput_device_config_accel_is_available | ( | struct libinput_device * | device | ) |

Check if a device uses libinput-internal pointer-acceleration.

Parameters

  device | The device to configure

Returns
  0 if the device is not accelerated, nonzero if it is accelerated

See also
  libinput_device_config_accel_set_speed
  libinput_device_config_accel_get_speed
  libinput_device_config_accel_get_default_speed

## ◆ libinput_device_config_accel_set_profile()

enum libinput_config_status libinput_device_config_accel_set_profile | ( | struct libinput_device * | device,
|  | enum libinput_config_accel_profile | mode
| ) |  |

Set the pointer acceleration profile of this pointer device to the given mode.

Parameters

  device | The device to configure
  mode | The mode to set the device to.

Returns
  A config status code

## ◆ libinput_device_config_accel_set_speed()

enum libinput_config_status libinput_device_config_accel_set_speed | ( | struct libinput_device * | device,
|  | double | speed
| ) |  |

Set the pointer acceleration speed of this pointer device within a range of [-1, 1], where 0 is the default acceleration for this device, -1 is the slowest acceleration and 1 is the maximum acceleration available on this device.

The actual pointer acceleration mechanism is implementation-dependent, as is the number of steps available within the range. libinput picks the semantically closest acceleration step if the requested value does not match a discrete setting.

Parameters

  device | The device to configure
  speed | The normalized speed, in a range of [-1, 1]

Returns
  A config status code

See also
  libinput_device_config_accel_is_available
  libinput_device_config_accel_get_speed
  libinput_device_config_accel_get_default_speed

## ◆ libinput_device_config_calibration_get_default_matrix()

int libinput_device_config_calibration_get_default_matrix | ( | struct libinput_device * | device,
|  | float | matrix[6]
| ) |  |

Return the default calibration matrix for this device.

On most devices, this is the identity matrix. If the udev property LIBINPUT_CALIBRATION_MATRIX is set on the respective udev device, that property's value becomes the default matrix, see Static device configuration via udev.

Parameters

  device | The device to configure
  matrix | Set to the array representing the first two rows of a 3x3 matrix as described in libinput_device_config_calibration_set_matrix().

Returns
  0 if no calibration is set and the returned matrix is the identity matrix, 1 otherwise

See also
  libinput_device_config_calibration_has_matrix
  libinput_device_config_calibration_set_matrix
  libinput_device_config_calibration_get_default_matrix

## ◆ libinput_device_config_calibration_get_matrix()

int libinput_device_config_calibration_get_matrix | ( | struct libinput_device * | device,
|  | float | matrix[6]
| ) |  |

Return the current calibration matrix for this device.

Parameters

  device | The device to configure
  matrix | Set to the array representing the first two rows of a 3x3 matrix as described in libinput_device_config_calibration_set_matrix().

Returns
  0 if no calibration is set and the returned matrix is the identity matrix, 1 otherwise

See also
  libinput_device_config_calibration_has_matrix
  libinput_device_config_calibration_set_matrix
  libinput_device_config_calibration_get_default_matrix

## ◆ libinput_device_config_calibration_has_matrix()

int libinput_device_config_calibration_has_matrix | ( | struct libinput_device * | device | ) |

Check if the device can be calibrated via a calibration matrix.

Parameters

  device | The device to check

Returns
  Non-zero if the device can be calibrated, zero otherwise.

See also
  libinput_device_config_calibration_set_matrix
  libinput_device_config_calibration_get_matrix
  libinput_device_config_calibration_get_default_matrix

## ◆ libinput_device_config_calibration_set_matrix()

enum libinput_config_status libinput_device_config_calibration_set_matrix | ( | struct libinput_device * | device,
|  | const float | matrix[6]
| ) |  |

Apply the 3x3 transformation matrix to absolute device coordinates.

This matrix has no effect on relative events.

Given a 6-element array [a, b, c, d, e, f], the matrix is applied as

[ a b c ] [ x ]
[ d e f ] * [ y ]
[ 0 0 1 ] [ 1 ]

The translation component (c, f) is expected to be normalized to the device coordinate range. For example, the matrix

[ 1 0 1 ]
[ 0 1 -1 ]
[ 0 0 1 ]

moves all coordinates by 1 device-width to the right and 1 device-height up.

The rotation matrix for rotation around the origin is defined as

[ cos(a) -sin(a) 0 ]
[ sin(a) cos(a) 0 ]
[ 0 0 1 ]

Note that any rotation requires an additional translation component to translate the rotated coordinates back into the original device space. The rotation matrixes for 90, 180 and 270 degrees clockwise are:

90 deg cw: 180 deg cw: 270 deg cw:
[ 0 -1 1] [ -1 0 1] [ 0 1 0 ]
[ 1 0 0] [ 0 -1 1] [ -1 0 1 ]
[ 0 0 1] [ 0 0 1] [ 0 0 1 ]

Parameters

  device | The device to configure
  matrix | An array representing the first two rows of a 3x3 matrix as described above.

Returns
  A config status code.

See also
  libinput_device_config_calibration_has_matrix
  libinput_device_config_calibration_get_matrix
  libinput_device_config_calibration_get_default_matrix

## ◆ libinput_device_config_click_get_default_method()

enum libinput_config_click_method libinput_device_config_click_get_default_method | ( | struct libinput_device * | device | ) |

Get the default button click method for this device.

The button click method defines when to generate software-emulated buttons, usually on a device that does not have a specific physical button available.

Parameters

  device | The device to configure

Returns
  The default button click method for this device

See also
  libinput_device_config_click_get_methods
  libinput_device_config_click_set_method
  libinput_device_config_click_get_method

## ◆ libinput_device_config_click_get_method()

enum libinput_config_click_method libinput_device_config_click_get_method | ( | struct libinput_device * | device | ) |

Get the button click method for this device.

The button click method defines when to generate software-emulated buttons, usually on a device that does not have a specific physical button available.

Parameters

  device | The device to configure

Returns
  The current button click method for this device

See also
  libinput_device_config_click_get_methods
  libinput_device_config_click_set_method
  libinput_device_config_click_get_default_method

## ◆ libinput_device_config_click_get_methods()

uint32_t libinput_device_config_click_get_methods | ( | struct libinput_device * | device | ) |

Check which button click methods a device supports.

The button click method defines when to generate software-emulated buttons, usually on a device that does not have a specific physical button available.

Parameters

  device | The device to configure

Returns
  A bitmask of possible methods.

See also
  libinput_device_config_click_get_methods
  libinput_device_config_click_set_method
  libinput_device_config_click_get_method

## ◆ libinput_device_config_click_set_method()

enum libinput_config_status libinput_device_config_click_set_method | ( | struct libinput_device * | device,
|  | enum libinput_config_click_method | method
| ) |  |

Set the button click method for this device.

The button click method defines when to generate software-emulated buttons, usually on a device that does not have a specific physical button available.

Note
  The selected click method may not take effect immediately. The device may require changing to a neutral state first before activating the new method.

Parameters

  device | The device to configure
  method | The button click method

Returns
  A config status code

See also
  libinput_device_config_click_get_methods
  libinput_device_config_click_get_method
  libinput_device_config_click_get_default_method

## ◆ libinput_device_config_dwt_get_default_enabled()

enum libinput_config_dwt_state libinput_device_config_dwt_get_default_enabled | ( | struct libinput_device * | device | ) |

Check if the disable-while typing feature is enabled on this device by default.

If the device does not support disable-while-typing, this function returns LIBINPUT_CONFIG_DWT_DISABLED.

Parameters

  device | The device to configure

Returns
  LIBINPUT_CONFIG_DWT_DISABLED if disabled, LIBINPUT_CONFIG_DWT_ENABLED if enabled.

See also
  libinput_device_config_dwt_is_available
  libinput_device_config_dwt_set_enabled
  libinput_device_config_dwt_get_enabled

## ◆ libinput_device_config_dwt_get_enabled()

enum libinput_config_dwt_state libinput_device_config_dwt_get_enabled | ( | struct libinput_device * | device | ) |

Check if the disable-while typing feature is currently enabled on this device.

If the device does not support disable-while-typing, this function returns LIBINPUT_CONFIG_DWT_DISABLED.

Parameters

  device | The device to configure

Returns
  LIBINPUT_CONFIG_DWT_DISABLED if disabled, LIBINPUT_CONFIG_DWT_ENABLED if enabled.

See also
  libinput_device_config_dwt_is_available
  libinput_device_config_dwt_set_enabled
  libinput_device_config_dwt_get_default_enabled

## ◆ libinput_device_config_dwt_is_available()

int libinput_device_config_dwt_is_available | ( | struct libinput_device * | device | ) |

Check if this device supports configurable disable-while-typing feature.

This feature is usually available on built-in touchpads and disables the touchpad while typing. See Disable-while-typing for details.

Parameters

  device | The device to configure

Returns
  0 if this device does not support disable-while-typing, or 1 otherwise.

See also
  libinput_device_config_dwt_set_enabled
  libinput_device_config_dwt_get_enabled
  libinput_device_config_dwt_get_default_enabled

## ◆ libinput_device_config_dwt_set_enabled()

enum libinput_config_status libinput_device_config_dwt_set_enabled | ( | struct libinput_device * | device,
|  | enum libinput_config_dwt_state | enable
| ) |  |

Enable or disable the disable-while-typing feature.

When enabled, the device will be disabled while typing and for a short period after. See Disable-while-typing for details.

Note
  Enabling or disabling disable-while-typing may not take effect immediately.

Parameters

  device | The device to configure
  enable | LIBINPUT_CONFIG_DWT_DISABLED to disable disable-while-typing, LIBINPUT_CONFIG_DWT_ENABLED to enable

Returns
  A config status code. Disabling disable-while-typing on a device that does not support the feature always succeeds.

See also
  libinput_device_config_dwt_is_available
  libinput_device_config_dwt_get_enabled
  libinput_device_config_dwt_get_default_enabled

## ◆ libinput_device_config_left_handed_get()

int libinput_device_config_left_handed_get | ( | struct libinput_device * | device | ) |

Get the current left-handed configuration of the device.

Parameters

  device | The device to configure

Returns
  Zero if the device is in right-handed mode, non-zero if the device is in left-handed mode

See also
  libinput_device_config_left_handed_is_available
  libinput_device_config_left_handed_set
  libinput_device_config_left_handed_get_default

## ◆ libinput_device_config_left_handed_get_default()

int libinput_device_config_left_handed_get_default | ( | struct libinput_device * | device | ) |

Get the default left-handed configuration of the device.

Parameters

  device | The device to configure

Returns
  Zero if the device is in right-handed mode by default, or non-zero if the device is in left-handed mode by default

See also
  libinput_device_config_left_handed_is_available
  libinput_device_config_left_handed_set
  libinput_device_config_left_handed_get

## ◆ libinput_device_config_left_handed_is_available()

int libinput_device_config_left_handed_is_available | ( | struct libinput_device * | device | ) |

Check if a device has a configuration that supports left-handed usage.

Parameters

  device | The device to configure

Returns
  Non-zero if the device can be set to left-handed, or zero otherwise

See also
  libinput_device_config_left_handed_set
  libinput_device_config_left_handed_get
  libinput_device_config_left_handed_get_default

## ◆ libinput_device_config_left_handed_set()

enum libinput_config_status libinput_device_config_left_handed_set | ( | struct libinput_device * | device,
|  | int | left_handed
| ) |  |

Set the left-handed configuration of the device.

The exact behavior is device-dependent. On a mouse and most pointing devices, left and right buttons are swapped but the middle button is unmodified. On a touchpad, physical buttons (if present) are swapped. On a clickpad, the top and bottom software-emulated buttons are swapped where present, the main area of the touchpad remains a left button. Tapping and clickfinger behavior is not affected by this setting.

Changing the left-handed configuration of a device may not take effect until all buttons have been logically released.

Parameters

  device | The device to configure
  left_handed | Zero to disable, non-zero to enable left-handed mode

Returns
  A configuration status code

See also
  libinput_device_config_left_handed_is_available
  libinput_device_config_left_handed_get
  libinput_device_config_left_handed_get_default

## ◆ libinput_device_config_middle_emulation_get_default_enabled()

enum libinput_config_middle_emulation_state libinput_device_config_middle_emulation_get_default_enabled | ( | struct libinput_device * | device | ) |

Check if configurable middle button emulation is enabled by default on this device.

See Middle button emulation for details.

If the device does not have configurable middle button emulation, this function returns LIBINPUT_CONFIG_MIDDLE_EMULATION_DISABLED.

Note
  Some devices provide middle mouse button emulation but do not allow enabling/disabling that emulation. These devices always return LIBINPUT_CONFIG_MIDDLE_EMULATION_DISABLED.

Parameters

  device | The device to configure

Returns
  LIBINPUT_CONFIG_MIDDLE_EMULATION_DISABLED If disabled or not available, LIBINPUT_CONFIG_MIDDLE_EMULATION_ENABLED if enabled.

See also
  libinput_device_config_middle_emulation_is_available
  libinput_device_config_middle_emulation_set_enabled
  libinput_device_config_middle_emulation_get_enabled

## ◆ libinput_device_config_middle_emulation_get_enabled()

enum libinput_config_middle_emulation_state libinput_device_config_middle_emulation_get_enabled | ( | struct libinput_device * | device | ) |

Check if configurable middle button emulation is enabled on this device.

See Middle button emulation for details.

If the device does not have configurable middle button emulation, this function returns LIBINPUT_CONFIG_MIDDLE_EMULATION_DISABLED.

Note
  Some devices provide middle mouse button emulation but do not allow enabling/disabling that emulation. These devices always return LIBINPUT_CONFIG_MIDDLE_EMULATION_DISABLED.

Parameters

  device | The device to configure

Returns
  LIBINPUT_CONFIG_MIDDLE_EMULATION_DISABLED if disabled or not available/configurable, LIBINPUT_CONFIG_MIDDLE_EMULATION_ENABLED If enabled.

See also
  libinput_device_config_middle_emulation_is_available
  libinput_device_config_middle_emulation_set_enabled
  libinput_device_config_middle_emulation_get_default_enabled

## ◆ libinput_device_config_middle_emulation_is_available()

int libinput_device_config_middle_emulation_is_available | ( | struct libinput_device * | device | ) |

Check if middle mouse button emulation configuration is available on this device.

See Middle button emulation for details.

Note
  Some devices provide middle mouse button emulation but do not allow enabling/disabling that emulation. These devices return zero in libinput_device_config_middle_emulation_is_available().

Parameters

  device | The device to query

Returns
  Non-zero if middle mouse button emulation is available and can be configured, zero otherwise.

See also
  libinput_device_config_middle_emulation_set_enabled
  libinput_device_config_middle_emulation_get_enabled
  libinput_device_config_middle_emulation_get_default_enabled

## ◆ libinput_device_config_middle_emulation_set_enabled()

enum libinput_config_status libinput_device_config_middle_emulation_set_enabled | ( | struct libinput_device * | device,
|  | enum libinput_config_middle_emulation_state | enable
| ) |  |

Enable or disable middle button emulation on this device.

When enabled, a simultaneous press of the left and right button generates a middle mouse button event. Releasing the buttons generates a middle mouse button release, the left and right button events are discarded otherwise.

See Middle button emulation for details.

Parameters

  device | The device to configure
  enable | LIBINPUT_CONFIG_MIDDLE_EMULATION_DISABLED to disable, LIBINPUT_CONFIG_MIDDLE_EMULATION_ENABLED To enable middle button emulation.

Returns
  A config status code. Disabling middle button emulation on a device that does not support middle button emulation always succeeds.

See also
  libinput_device_config_middle_emulation_is_available
  libinput_device_config_middle_emulation_get_enabled
  libinput_device_config_middle_emulation_get_default_enabled

## ◆ libinput_device_config_rotation_get_angle()

unsigned int libinput_device_config_rotation_get_angle | ( | struct libinput_device * | device | ) |

Get the current rotation of a device in degrees clockwise off the logical neutral position.

If this device does not support rotation, the return value is always 0.

Parameters

  device | The device to configure

Returns
  The angle in degrees clockwise

See also
  libinput_device_config_rotation_is_available
  libinput_device_config_rotation_set_angle
  libinput_device_config_rotation_get_default_angle

## ◆ libinput_device_config_rotation_get_default_angle()

unsigned int libinput_device_config_rotation_get_default_angle | ( | struct libinput_device * | device | ) |

Get the default rotation of a device in degrees clockwise off the logical neutral position.

If this device does not support rotation, the return value is always 0.

Parameters

  device | The device to configure

Returns
  The default angle in degrees clockwise

See also
  libinput_device_config_rotation_is_available
  libinput_device_config_rotation_set_angle
  libinput_device_config_rotation_get_angle

## ◆ libinput_device_config_rotation_is_available()

int libinput_device_config_rotation_is_available | ( | struct libinput_device * | device | ) |

Check whether a device can have a custom rotation applied.

Parameters

  device | The device to configure

Returns
  Non-zero if a device can be rotated, zero otherwise.

See also
  libinput_device_config_rotation_set_angle
  libinput_device_config_rotation_get_angle
  libinput_device_config_rotation_get_default_angle

## ◆ libinput_device_config_rotation_set_angle()

enum libinput_config_status libinput_device_config_rotation_set_angle | ( | struct libinput_device * | device,
|  | unsigned int | degrees_cw
| ) |  |

Set the rotation of a device in degrees clockwise off the logical neutral position.

Any subsequent motion events are adjusted according to the given angle.

The angle has to be in the range of [0, 360[ degrees, otherwise this function returns LIBINPUT_CONFIG_STATUS_INVALID. If the angle is a multiple of 360 or negative, the caller must ensure the correct ranging before calling this function.

libinput guarantees that this function accepts multiples of 90 degrees. If a value is within the [0, 360[ range but not a multiple of 90 degrees, this function may return LIBINPUT_CONFIG_STATUS_INVALID if the underlying device or implementation does not support finer-grained rotation angles.

The rotation angle is applied to all motion events emitted by the device. Thus, rotating the device also changes the angle required or presented by scrolling, gestures, etc.

Parameters

  device | The device to configure
  degrees_cw | The angle in degrees clockwise

Returns
  A config status code. Setting a rotation of 0 degrees on a device that does not support rotation always succeeds.

See also
  libinput_device_config_rotation_is_available
  libinput_device_config_rotation_get_angle
  libinput_device_config_rotation_get_default_angle

## ◆ libinput_device_config_scroll_get_button()

uint32_t libinput_device_config_scroll_get_button | ( | struct libinput_device * | device | ) |

Get the button for the LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN method for this device.

If LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN scroll method is not supported, or no button is set, this function returns 0.

Note
  The return value is independent of the currently selected scroll-method. For button scrolling to activate, a device must have the LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN method enabled, and a non-zero button set as scroll button.

Parameters

  device | The device to configure

Returns
  The button which when pressed switches to sending scroll events

See also
  libinput_device_config_scroll_get_methods
  libinput_device_config_scroll_set_method
  libinput_device_config_scroll_get_method
  libinput_device_config_scroll_get_default_method
  libinput_device_config_scroll_set_button
  libinput_device_config_scroll_get_default_button

## ◆ libinput_device_config_scroll_get_default_button()

uint32_t libinput_device_config_scroll_get_default_button | ( | struct libinput_device * | device | ) |

Get the default button for the LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN method for this device.

If LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN scroll method is not supported, or no default button is set, this function returns 0.

Parameters

  device | The device to configure

Returns
  The default button for the LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN method

See also
  libinput_device_config_scroll_get_methods
  libinput_device_config_scroll_set_method
  libinput_device_config_scroll_get_method
  libinput_device_config_scroll_get_default_method
  libinput_device_config_scroll_set_button
  libinput_device_config_scroll_get_button

## ◆ libinput_device_config_scroll_get_default_method()

enum libinput_config_scroll_method libinput_device_config_scroll_get_default_method | ( | struct libinput_device * | device | ) |

Get the default scroll method for this device.

The method defines when to generate scroll axis events instead of pointer motion events.

Parameters

  device | The device to configure

Returns
  The default scroll method for this device.

See also
  libinput_device_config_scroll_get_methods
  libinput_device_config_scroll_set_method
  libinput_device_config_scroll_get_method
  libinput_device_config_scroll_set_button
  libinput_device_config_scroll_get_button
  libinput_device_config_scroll_get_default_button

## ◆ libinput_device_config_scroll_get_default_natural_scroll_enabled()

int libinput_device_config_scroll_get_default_natural_scroll_enabled | ( | struct libinput_device * | device | ) |

Get the default mode for scrolling on this device.

Parameters

  device | The device to configure

Returns
  Zero if natural scrolling is disabled by default, non-zero if enabled

See also
  libinput_device_config_scroll_has_natural_scroll
  libinput_device_config_scroll_set_natural_scroll_enabled
  libinput_device_config_scroll_get_natural_scroll_enabled

## ◆ libinput_device_config_scroll_get_method()

enum libinput_config_scroll_method libinput_device_config_scroll_get_method | ( | struct libinput_device * | device | ) |

Get the scroll method for this device.

The method defines when to generate scroll axis events instead of pointer motion events.

Parameters

  device | The device to configure

Returns
  The current scroll method for this device.

See also
  libinput_device_config_scroll_get_methods
  libinput_device_config_scroll_set_method
  libinput_device_config_scroll_get_default_method
  libinput_device_config_scroll_set_button
  libinput_device_config_scroll_get_button
  libinput_device_config_scroll_get_default_button

## ◆ libinput_device_config_scroll_get_methods()

uint32_t libinput_device_config_scroll_get_methods | ( | struct libinput_device * | device | ) |

Check which scroll methods a device supports.

The method defines when to generate scroll axis events instead of pointer motion events.

Parameters

  device | The device to configure

Returns
  A bitmask of possible methods.

See also
  libinput_device_config_scroll_set_method
  libinput_device_config_scroll_get_method
  libinput_device_config_scroll_get_default_method
  libinput_device_config_scroll_set_button
  libinput_device_config_scroll_get_button
  libinput_device_config_scroll_get_default_button

## ◆ libinput_device_config_scroll_get_natural_scroll_enabled()

int libinput_device_config_scroll_get_natural_scroll_enabled | ( | struct libinput_device * | device | ) |

Get the current mode for scrolling on this device.

Parameters

  device | The device to configure

Returns
  Zero if natural scrolling is disabled, non-zero if enabled

See also
  libinput_device_config_scroll_has_natural_scroll
  libinput_device_config_scroll_set_natural_scroll_enabled
  libinput_device_config_scroll_get_default_natural_scroll_enabled

## ◆ libinput_device_config_scroll_has_natural_scroll()

int libinput_device_config_scroll_has_natural_scroll | ( | struct libinput_device * | device | ) |

Return non-zero if the device supports "natural scrolling".

In traditional scroll mode, the movement of fingers on a touchpad when scrolling matches the movement of the scroll bars. When the fingers move down, the scroll bar moves down, a line of text on the screen moves towards the upper end of the screen. This also matches scroll wheels on mice (wheel down, content moves up).

Natural scrolling is the term coined by Apple for inverted scrolling. In this mode, the effect of scrolling movement of fingers on a touchpad resemble physical manipulation of paper. When the fingers move down, a line of text on the screen moves down (scrollbars move up). This is the opposite of scroll wheels on mice.

A device supporting natural scrolling can be switched between traditional scroll mode and natural scroll mode.

Parameters

  device | The device to configure

Returns
  Zero if natural scrolling is not supported, non-zero if natural scrolling is supported by this device

See also
  libinput_device_config_scroll_set_natural_scroll_enabled
  libinput_device_config_scroll_get_natural_scroll_enabled
  libinput_device_config_scroll_get_default_natural_scroll_enabled

## ◆ libinput_device_config_scroll_set_button()

enum libinput_config_status libinput_device_config_scroll_set_button | ( | struct libinput_device * | device,
|  | uint32_t | button
| ) |  |

Set the button for the LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN method for this device.

When the current scroll method is set to LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN, no button press/release events will be send for the configured button.

When the configured button is pressed, any motion events along a scroll-capable axis are turned into scroll axis events.

Note
  Setting the button does not change the scroll method. To change the scroll method call libinput_device_config_scroll_set_method().

If the button is 0, button scrolling is effectively disabled.

Parameters

  device | The device to configure
  button | The button which when pressed switches to sending scroll events

Returns
  A config status code

Return values

  LIBINPUT_CONFIG_STATUS_SUCCESS | On success
  LIBINPUT_CONFIG_STATUS_UNSUPPORTED | If LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN is not supported
  LIBINPUT_CONFIG_STATUS_INVALID | The given button does not exist on this device

See also
  libinput_device_config_scroll_get_methods
  libinput_device_config_scroll_set_method
  libinput_device_config_scroll_get_method
  libinput_device_config_scroll_get_default_method
  libinput_device_config_scroll_get_button
  libinput_device_config_scroll_get_default_button

## ◆ libinput_device_config_scroll_set_method()

enum libinput_config_status libinput_device_config_scroll_set_method | ( | struct libinput_device * | device,
|  | enum libinput_config_scroll_method | method
| ) |  |

Set the scroll method for this device.

The method defines when to generate scroll axis events instead of pointer motion events.

Note
  Setting LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN enables the scroll method, but scrolling is only activated when the configured button is held down. If no button is set, i.e. libinput_device_config_scroll_get_button() returns 0, scrolling cannot activate.

Parameters

  device | The device to configure
  method | The scroll method for this device.

Returns
  A config status code.

See also
  libinput_device_config_scroll_get_methods
  libinput_device_config_scroll_get_method
  libinput_device_config_scroll_get_default_method
  libinput_device_config_scroll_set_button
  libinput_device_config_scroll_get_button
  libinput_device_config_scroll_get_default_button

## ◆ libinput_device_config_scroll_set_natural_scroll_enabled()

enum libinput_config_status libinput_device_config_scroll_set_natural_scroll_enabled | ( | struct libinput_device * | device,
|  | int | enable
| ) |  |

Enable or disable natural scrolling on the device.

Parameters

  device | The device to configure
  enable | non-zero to enable, zero to disable natural scrolling

Returns
  A config status code

See also
  libinput_device_config_scroll_has_natural_scroll
  libinput_device_config_scroll_get_natural_scroll_enabled
  libinput_device_config_scroll_get_default_natural_scroll_enabled

## ◆ libinput_device_config_send_events_get_default_mode()

uint32_t libinput_device_config_send_events_get_default_mode | ( | struct libinput_device * | device | ) |

Get the default send-event mode for this device.

The mode defines when the device processes and sends events to the caller.

Parameters

  device | The device to configure

Returns
  The bitmask of the send-event mode for this device.

See also
  libinput_device_config_send_events_get_modes
  libinput_device_config_send_events_set_mode
  libinput_device_config_send_events_get_mode

## ◆ libinput_device_config_send_events_get_mode()

uint32_t libinput_device_config_send_events_get_mode | ( | struct libinput_device * | device | ) |

Get the send-event mode for this device.

The mode defines when the device processes and sends events to the caller.

If a caller enables the bits for multiple modes, some of which are subsets of another mode libinput may drop the bits that are subsets. In other words, don't expect libinput_device_config_send_events_get_mode() to always return exactly the same bitmask as passed into libinput_device_config_send_events_set_mode().

Parameters

  device | The device to configure

Returns
  The current bitmask of the send-event mode for this device.

See also
  libinput_device_config_send_events_get_modes
  libinput_device_config_send_events_set_mode
  libinput_device_config_send_events_get_default_mode

## ◆ libinput_device_config_send_events_get_modes()

uint32_t libinput_device_config_send_events_get_modes | ( | struct libinput_device * | device | ) |

Return the possible send-event modes for this device.

These modes define when a device may process and send events.

Parameters

  device | The device to configure

Returns
  A bitmask of possible modes.

See also
  libinput_device_config_send_events_set_mode
  libinput_device_config_send_events_get_mode
  libinput_device_config_send_events_get_default_mode

## ◆ libinput_device_config_send_events_set_mode()

enum libinput_config_status libinput_device_config_send_events_set_mode | ( | struct libinput_device * | device,
|  | uint32_t | mode
| ) |  |

Set the send-event mode for this device.

The mode defines when the device processes and sends events to the caller.

The selected mode may not take effect immediately. Events already received and processed from this device are unaffected and will be passed to the caller on the next call to libinput_get_event().

If the mode is a bitmask of libinput_config_send_events_mode, the device may wait for or generate events until it is in a neutral state. For example, this may include waiting for or generating button release events.

If the device is already suspended, this function does nothing and returns success. Changing the send-event mode on a device that has been removed is permitted.

Parameters

  device | The device to configure
  mode | A bitmask of send-events modes

Returns
  A config status code.

See also
  libinput_device_config_send_events_get_modes
  libinput_device_config_send_events_get_mode
  libinput_device_config_send_events_get_default_mode

## ◆ libinput_device_config_tap_get_button_map()

enum libinput_config_tap_button_map libinput_device_config_tap_get_button_map | ( | struct libinput_device * | device | ) |

Get the finger number to button number mapping for tap-to-click.

The return value for a device that does not support tapping is always LIBINPUT_CONFIG_TAP_MAP_LRM.

Note
  It is an application bug to call this function for devices where libinput_device_config_tap_get_finger_count() returns 0.

Parameters

  device | The device to configure

Returns
  The current finger-to-button number mapping

See also
  libinput_device_config_tap_set_button_map
  libinput_device_config_tap_get_default_button_map

## ◆ libinput_device_config_tap_get_default_button_map()

enum libinput_config_tap_button_map libinput_device_config_tap_get_default_button_map | ( | struct libinput_device * | device | ) |

Get the default finger number to button number mapping for tap-to-click.

The return value for a device that does not support tapping is always LIBINPUT_CONFIG_TAP_MAP_LRM.

Note
  It is an application bug to call this function for devices where libinput_device_config_tap_get_finger_count() returns 0.

Parameters

  device | The device to configure

Returns
  The current finger-to-button number mapping

See also
  libinput_device_config_tap_set_button_map
  libinput_device_config_tap_get_default_button_map

## ◆ libinput_device_config_tap_get_default_drag_enabled()

enum libinput_config_drag_state libinput_device_config_tap_get_default_drag_enabled | ( | struct libinput_device * | device | ) |

Return whether tap-and-drag is enabled or disabled by default on this device.

Parameters

  device | The device to check

Return values

  LIBINPUT_CONFIG_DRAG_ENABLED | if tap-and-drag is enabled by default
  LIBINPUT_CONFIG_DRAG_DISABLED | if tap-and-drag is disabled by default

See also
  libinput_device_config_tap_drag_set_enabled
  libinput_device_config_tap_drag_get_enabled

## ◆ libinput_device_config_tap_get_default_drag_lock_enabled()

enum libinput_config_drag_lock_state libinput_device_config_tap_get_default_drag_lock_enabled | ( | struct libinput_device * | device | ) |

Check if drag-lock during tapping is enabled by default on this device.

If the device does not support tapping, this function always returns LIBINPUT_CONFIG_DRAG_LOCK_DISABLED.

Drag lock may be enabled by default even when tapping is disabled by default.

Parameters

  device | The device to configure

Return values

  LIBINPUT_CONFIG_DRAG_LOCK_ENABLED | If drag lock is enabled by default
  LIBINPUT_CONFIG_DRAG_LOCK_DISABLED | If drag lock is disabled by default

See also
  libinput_device_config_tap_set_drag_lock_enabled
  libinput_device_config_tap_get_drag_lock_enabled

## ◆ libinput_device_config_tap_get_default_enabled()

enum libinput_config_tap_state libinput_device_config_tap_get_default_enabled | ( | struct libinput_device * | device | ) |

Return the default setting for whether tap-to-click is enabled on this device.

Parameters

  device | The device to configure

Return values

  LIBINPUT_CONFIG_TAP_ENABLED | If tapping is enabled by default
  LIBINPUT_CONFIG_TAP_DISABLED | If tapping Is disabled by default

See also
  libinput_device_config_tap_get_finger_count
  libinput_device_config_tap_set_enabled
  libinput_device_config_tap_get_enabled

## ◆ libinput_device_config_tap_get_drag_enabled()

enum libinput_config_drag_state libinput_device_config_tap_get_drag_enabled | ( | struct libinput_device * | device | ) |

Return whether tap-and-drag is enabled or disabled on this device.

Parameters

  device | The device to check

Return values

  LIBINPUT_CONFIG_DRAG_ENABLED | if tap-and-drag is enabled
  LIBINPUT_CONFIG_DRAG_DISABLED | if tap-and-drag is disabled

See also
  libinput_device_config_tap_drag_set_enabled
  libinput_device_config_tap_drag_get_default_enabled

## ◆ libinput_device_config_tap_get_drag_lock_enabled()

enum libinput_config_drag_lock_state libinput_device_config_tap_get_drag_lock_enabled | ( | struct libinput_device * | device | ) |

Check if drag-lock during tapping is enabled on this device.

If the device does not support tapping, this function always returns LIBINPUT_CONFIG_DRAG_LOCK_DISABLED.

Drag lock may be enabled even when tapping is disabled.

Parameters

  device | The device to configure

Return values

  LIBINPUT_CONFIG_DRAG_LOCK_ENABLED | If drag lock is currently enabled
  LIBINPUT_CONFIG_DRAG_LOCK_DISABLED | If drag lock is currently disabled

See also
  libinput_device_config_tap_set_drag_lock_enabled
  libinput_device_config_tap_get_default_drag_lock_enabled

## ◆ libinput_device_config_tap_get_enabled()

enum libinput_config_tap_state libinput_device_config_tap_get_enabled | ( | struct libinput_device * | device | ) |

Check if tap-to-click is enabled on this device.

If the device does not support tapping, this function always returns LIBINPUT_CONFIG_TAP_DISABLED.

Parameters

  device | The device to configure

Return values

  LIBINPUT_CONFIG_TAP_ENABLED | If tapping is currently enabled
  LIBINPUT_CONFIG_TAP_DISABLED | If tapping is currently disabled

See also
  libinput_device_config_tap_get_finger_count
  libinput_device_config_tap_set_enabled
  libinput_device_config_tap_get_default_enabled

## ◆ libinput_device_config_tap_get_finger_count()

int libinput_device_config_tap_get_finger_count | ( | struct libinput_device * | device | ) |

Check if the device supports tap-to-click and how many fingers can be used for tapping.

See libinput_device_config_tap_set_enabled() for more information.

Parameters

  device | The device to configure

Returns
  The number of fingers that can generate a tap event, or 0 if the device does not support tapping.

See also
  libinput_device_config_tap_set_enabled
  libinput_device_config_tap_get_enabled
  libinput_device_config_tap_get_default_enabled

## ◆ libinput_device_config_tap_set_button_map()

enum libinput_config_status libinput_device_config_tap_set_button_map | ( | struct libinput_device * | device,
|  | enum libinput_config_tap_button_map | map
| ) |  |

Set the finger number to button number mapping for tap-to-click.

The default mapping on most devices is to have a 1, 2 and 3 finger tap to map to the left, right and middle button, respectively. A device may permit changing the button mapping but disallow specific maps. In this case LIBINPUT_CONFIG_STATUS_UNSUPPORTED is returned, the caller is expected to handle this case correctly.

Changing the button mapping may not take effect immediately, the device may wait until it is in a neutral state before applying any changes.

The mapping may be changed when tap-to-click is disabled. The new mapping takes effect when tap-to-click is enabled in the future.

Note
  It is an application bug to call this function for devices where libinput_device_config_tap_get_finger_count() returns 0.

Parameters

  device | The device to configure
  map | The new finger-to-button number mapping

Returns
  A config status code. Changing the order on a device that does not support tapping always fails with LIBINPUT_CONFIG_STATUS_UNSUPPORTED.

See also
  libinput_device_config_tap_get_button_map
  libinput_device_config_tap_get_default_button_map

## ◆ libinput_device_config_tap_set_drag_enabled()

enum libinput_config_status libinput_device_config_tap_set_drag_enabled | ( | struct libinput_device * | device,
|  | enum libinput_config_drag_state | enable
| ) |  |

Enable or disable tap-and-drag on this device.

When enabled, a single-finger tap immediately followed by a finger down results in a button down event, subsequent finger motion thus triggers a drag. The button is released on finger up. See Tap-and-drag for more details.

Parameters

  device | The device to configure
  enable | LIBINPUT_CONFIG_DRAG_ENABLED to enable, LIBINPUT_CONFIG_DRAG_DISABLED to disable tap-and-drag

See also
  libinput_device_config_tap_drag_get_enabled
  libinput_device_config_tap_drag_get_default_enabled

## ◆ libinput_device_config_tap_set_drag_lock_enabled()

enum libinput_config_status libinput_device_config_tap_set_drag_lock_enabled | ( | struct libinput_device * | device,
|  | enum libinput_config_drag_lock_state | enable
| ) |  |

Enable or disable drag-lock during tapping on this device.

When enabled, a finger may be lifted and put back on the touchpad within a timeout and the drag process continues. When disabled, lifting the finger during a tap-and-drag will immediately stop the drag. See Tap-and-drag for details.

Enabling drag lock on a device that has tapping disabled is permitted, but has no effect until tapping is enabled.

Parameters

  device | The device to configure
  enable | LIBINPUT_CONFIG_DRAG_LOCK_ENABLED to enable drag lock or LIBINPUT_CONFIG_DRAG_LOCK_DISABLED to disable drag lock

Returns
  A config status code. Disabling drag lock on a device that does not support tapping always succeeds.

See also
  libinput_device_config_tap_get_drag_lock_enabled
  libinput_device_config_tap_get_default_drag_lock_enabled

## ◆ libinput_device_config_tap_set_enabled()

enum libinput_config_status libinput_device_config_tap_set_enabled | ( | struct libinput_device * | device,
|  | enum libinput_config_tap_state | enable
| ) |  |

Enable or disable tap-to-click on this device, with a default mapping of 1, 2, 3 finger tap mapping to left, right, middle click, respectively.

Tapping is limited by the number of simultaneous touches supported by the device, see libinput_device_config_tap_get_finger_count().

Parameters

  device | The device to configure
  enable | LIBINPUT_CONFIG_TAP_ENABLED to enable tapping or LIBINPUT_CONFIG_TAP_DISABLED to disable tapping

Returns
  A config status code. Disabling tapping on a device that does not support tapping always succeeds.

See also
  libinput_device_config_tap_get_finger_count
  libinput_device_config_tap_get_enabled
  libinput_device_config_tap_get_default_enabled