Enable, disable, change and/or check for device-specific features. More...
Data Structures | |
struct | libinput_config_area_rectangle |
Describes a rectangle to configure a device's area, see libinput_device_config_area_set_rectangle(). More... | |
Functions | |
const char * | libinput_config_status_to_str (enum libinput_config_status status) |
Return a string describing the error. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
int | libinput_device_config_calibration_has_matrix (struct libinput_device *device) |
Check if the device can be calibrated via a calibration 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. | |
int | libinput_device_config_calibration_get_matrix (struct libinput_device *device, float matrix[6]) |
Return the current calibration matrix for this device. | |
int | libinput_device_config_calibration_get_default_matrix (struct libinput_device *device, float matrix[6]) |
Return the default calibration matrix for this device. | |
int | libinput_device_config_area_has_rectangle (struct libinput_device *device) |
Check if the device can change its logical input area via a rectangle. | |
enum libinput_config_status | libinput_device_config_area_set_rectangle (struct libinput_device *device, const struct libinput_config_area_rectangle *rect) |
Set the given rectangle as the logical input area of this device. | |
struct libinput_config_area_rectangle | libinput_device_config_area_get_rectangle (struct libinput_device *device) |
Return the current area rectangle for this device. | |
struct libinput_config_area_rectangle | libinput_device_config_area_get_default_rectangle (struct libinput_device *device) |
Return the default area rectangle for this device. | |
uint32_t | libinput_device_config_send_events_get_modes (struct libinput_device *device) |
Return the possible send-event modes for this device. | |
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. | |
uint32_t | libinput_device_config_send_events_get_mode (struct libinput_device *device) |
Get the send-event mode for this device. | |
uint32_t | libinput_device_config_send_events_get_default_mode (struct libinput_device *device) |
Get the default send-event mode for this device. | |
int | libinput_device_config_accel_is_available (struct libinput_device *device) |
Check if a device uses libinput-internal pointer-acceleration. | |
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. | |
double | libinput_device_config_accel_get_speed (struct libinput_device *device) |
Get the current pointer acceleration setting for this pointer device. | |
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]. | |
struct libinput_config_accel * | libinput_config_accel_create (enum libinput_config_accel_profile profile) |
Create an acceleration configuration of a given profile. | |
void | libinput_config_accel_destroy (struct libinput_config_accel *accel_config) |
Destroy an acceleration configuration. | |
enum libinput_config_status | libinput_device_config_accel_apply (struct libinput_device *device, struct libinput_config_accel *accel_config) |
Apply this pointer acceleration configuration to the device. | |
enum libinput_config_status | libinput_config_accel_set_points (struct libinput_config_accel *accel_config, enum libinput_config_accel_type accel_type, double step, size_t npoints, double *points) |
Defines the acceleration function for a given movement type in an acceleration configuration with the profile LIBINPUT_CONFIG_ACCEL_PROFILE_CUSTOM. | |
uint32_t | libinput_device_config_accel_get_profiles (struct libinput_device *device) |
Returns a bitmask of the configurable acceleration modes available on this device. | |
enum libinput_config_status | libinput_device_config_accel_set_profile (struct libinput_device *device, enum libinput_config_accel_profile profile) |
Set the pointer acceleration profile of this pointer device to the given mode. | |
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. | |
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. | |
int | libinput_device_config_scroll_has_natural_scroll (struct libinput_device *device) |
Return non-zero if the device supports "natural scrolling". | |
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. | |
int | libinput_device_config_scroll_get_natural_scroll_enabled (struct libinput_device *device) |
Get the current mode for scrolling on this device. | |
int | libinput_device_config_scroll_get_default_natural_scroll_enabled (struct libinput_device *device) |
Get the default mode for scrolling on this device. | |
int | libinput_device_config_left_handed_is_available (struct libinput_device *device) |
Check if a device has a configuration that supports left-handed usage. | |
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. | |
int | libinput_device_config_left_handed_get (struct libinput_device *device) |
Get the current left-handed configuration of the device. | |
int | libinput_device_config_left_handed_get_default (struct libinput_device *device) |
Get the default left-handed configuration of the device. | |
uint32_t | libinput_device_config_click_get_methods (struct libinput_device *device) |
Check which button click methods a device supports. | |
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. | |
enum libinput_config_click_method | libinput_device_config_click_get_method (struct libinput_device *device) |
Get the button click method for this device. | |
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. | |
enum libinput_config_status | libinput_device_config_click_set_clickfinger_button_map (struct libinput_device *device, enum libinput_config_clickfinger_button_map map) |
Set the finger number to button number mapping for clickfinger. | |
enum libinput_config_clickfinger_button_map | libinput_device_config_click_get_clickfinger_button_map (struct libinput_device *device) |
Get the finger number to button number mapping for clickfinger. | |
enum libinput_config_clickfinger_button_map | libinput_device_config_click_get_default_clickfinger_button_map (struct libinput_device *device) |
Get the default finger number to button number mapping for clickfinger. | |
int | libinput_device_config_middle_emulation_is_available (struct libinput_device *device) |
Check if middle mouse button emulation configuration is available on this device. | |
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. | |
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. | |
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. | |
uint32_t | libinput_device_config_scroll_get_methods (struct libinput_device *device) |
Check which scroll methods a device supports. | |
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. | |
enum libinput_config_scroll_method | libinput_device_config_scroll_get_method (struct libinput_device *device) |
Get the scroll method for this device. | |
enum libinput_config_scroll_method | libinput_device_config_scroll_get_default_method (struct libinput_device *device) |
Get the default scroll method for this device. | |
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. | |
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. | |
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. | |
enum libinput_config_status | libinput_device_config_scroll_set_button_lock (struct libinput_device *device, enum libinput_config_scroll_button_lock_state state) |
Set the scroll button lock. | |
enum libinput_config_scroll_button_lock_state | libinput_device_config_scroll_get_button_lock (struct libinput_device *device) |
Get the current scroll button lock state. | |
enum libinput_config_scroll_button_lock_state | libinput_device_config_scroll_get_default_button_lock (struct libinput_device *device) |
Get the default scroll button lock state. | |
int | libinput_device_config_dwt_is_available (struct libinput_device *device) |
Check if this device supports configurable disable-while-typing feature. | |
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. | |
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. | |
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. | |
int | libinput_device_config_dwtp_is_available (struct libinput_device *device) |
Check if this device supports configurable disable-while-trackpointing feature. | |
enum libinput_config_status | libinput_device_config_dwtp_set_enabled (struct libinput_device *device, enum libinput_config_dwtp_state enable) |
Enable or disable the disable-while-trackpointing feature. | |
enum libinput_config_dwtp_state | libinput_device_config_dwtp_get_enabled (struct libinput_device *device) |
Check if the disable-while trackpointing feature is currently enabled on this device. | |
enum libinput_config_dwtp_state | libinput_device_config_dwtp_get_default_enabled (struct libinput_device *device) |
Check if the disable-while trackpointing feature is enabled on this device by default. | |
int | libinput_device_config_rotation_is_available (struct libinput_device *device) |
Check whether a device can have a custom rotation applied. | |
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. | |
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. | |
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. | |
int | libinput_tablet_tool_config_pressure_range_is_available (struct libinput_tablet_tool *tool) |
Check if a tablet tool can have a custom pressure range. | |
enum libinput_config_status | libinput_tablet_tool_config_pressure_range_set (struct libinput_tablet_tool *tool, double minimum, double maximum) |
Set the pressure range for this tablet tool. | |
double | libinput_tablet_tool_config_pressure_range_get_minimum (struct libinput_tablet_tool *tool) |
Get the minimum pressure value for this tablet tool, normalized to the range [0.0, 1.0] of the available hardware pressure. | |
double | libinput_tablet_tool_config_pressure_range_get_maximum (struct libinput_tablet_tool *tool) |
Get the maximum pressure value for this tablet tool, normalized to the range [0.0, 1.0] of the available hardware pressure. | |
double | libinput_tablet_tool_config_pressure_range_get_default_minimum (struct libinput_tablet_tool *tool) |
Get the minimum pressure value for this tablet tool, normalized to the range [0.0, 1.0] of the available hardware pressure. | |
double | libinput_tablet_tool_config_pressure_range_get_default_maximum (struct libinput_tablet_tool *tool) |
Get the maximum pressure value for this tablet tool, normalized to the range [0.0, 1.0] of the available hardware pressure. | |
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_click_set_clickfinger_button_map()
- libinput_device_config_scroll_set_method()
- libinput_device_config_dwt_set_enabled()
- Touchscreens:
- Tablets:
- Pointer devices (mice, trackballs, touchpads):
- All devices:
Enumeration Type Documentation
◆ libinput_config_accel_profile
- Since
- 1.1
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. |
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_ACCEL_PROFILE_CUSTOM | A custom acceleration profile. Device movement acceleration depends on user defined custom acceleration functions for each movement type.
|
◆ libinput_config_accel_type
Acceleration types are categories of movement by a device that may have specific acceleration functions applied.
A device always supports the LIBINPUT_ACCEL_TYPE_MOTION type (for regular pointer motion). Other types (e.g. scrolling) may be added in the future.
The special type LIBINPUT_ACCEL_TYPE_FALLBACK specifies the acceleration function to be moved for any movement produced by the device that does not have a specific acceleration type defined.
Use to specify the acceleration function type in libinput_config_accel_set_points
Each device implements a subset of those types, see a list of supported devices for each movement type definition.
- See also
- LIBINPUT_ACCEL_ARG_TYPE
- Since
- 1.23
◆ 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.
◆ libinput_config_clickfinger_button_map
◆ libinput_config_drag_lock_state
◆ 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()
- Since
- 1.2
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
◆ libinput_config_dwtp_state
◆ libinput_config_middle_emulation_state
◆ libinput_config_scroll_method
The scroll method of a device selects when to generate scroll axis events instead of pointer motion events.
◆ 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
◆ libinput_config_tap_button_map
◆ libinput_config_tap_state
Function Documentation
◆ libinput_config_accel_create()
struct libinput_config_accel * libinput_config_accel_create | ( | enum libinput_config_accel_profile | profile | ) |
Create an acceleration configuration of a given profile.
Note that in this version of libinput, only the LIBINPUT_CONFIG_ACCEL_PROFILE_CUSTOM profile provides configuration options. All other acceleration profiles, when applied, will merely switch the profile and reset any profile-specific options to the default values.
- Parameters
-
profile The profile of the newly created acceleration configuration.
- Returns
- The newly created acceleration configuration or NULL on error.
- Warning
- Unlike other structs pointer acceleration configuration is considered transient and not refcounted. Calling libinput_config_accel_destroy() will destroy the configuration.
- See also
- libinput_config_accel
- Since
- 1.23
◆ libinput_config_accel_destroy()
void libinput_config_accel_destroy | ( | struct libinput_config_accel * | accel_config | ) |
Destroy an acceleration configuration.
- Warning
- Unlike other structs pointer acceleration configuration is considered transient and not refcounted. Calling libinput_config_accel_destroy() will destroy the configuration.
- Parameters
-
accel_config The acceleration configuration to destroy.
- See also
- libinput_config_accel
- Since
- 1.23
◆ libinput_config_accel_set_points()
enum libinput_config_status libinput_config_accel_set_points | ( | struct libinput_config_accel * | accel_config, |
enum libinput_config_accel_type | accel_type, | ||
double | step, | ||
size_t | npoints, | ||
double * | points | ||
) |
Defines the acceleration function for a given movement type in an acceleration configuration with the profile LIBINPUT_CONFIG_ACCEL_PROFILE_CUSTOM.
Movement types are specific to each device,
- See also
- libinput_config_accel_type.
Each custom acceleration function is defined by n
points spaced uniformly along the x-axis starting from 0 and continuing in a constant step size. There by the function is defined by the following points: (0 * step, f[0]), (1 * step, f[1]), ..., ((n - 1) * step, f[n - 1]). The x-axis represents the device-speed in device units per millisecond. The y-axis represents the pointer-speed.
It is up to the user to define those values in accordance with device DPI and screen DPI.
- Parameters
-
accel_config The acceleration configuration to modify. accel_type The movement type to configure a custom function for. step The distance between each point along the x-axis. npoints The number of points of the custom acceleration function. points The points' y-values of the custom acceleration function.
- Returns
- A config status code.
- See also
- libinput_config_accel
- Since
- 1.23
◆ 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_apply()
enum libinput_config_status libinput_device_config_accel_apply | ( | struct libinput_device * | device, |
struct libinput_config_accel * | accel_config | ||
) |
Apply this pointer acceleration configuration to the device.
This changes the device's pointer acceleration method to the method given in libinput_config_accel_create() and applies all other configuration settings.
Once applied, call libinput_config_accel_destroy() to destroy the configuration struct.
- Parameters
-
device The device to configure. accel_config The acceleration configuration.
- Returns
- A config status code.
- See also
- libinput_config_accel
- Since
- 1.23
◆ 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.
- Since
- 1.1
◆ 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.
◆ 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.
- Since
- 1.1
◆ 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.
- Since
- 1.1
◆ 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.
If the current acceleration profile is LIBINPUT_CONFIG_ACCEL_PROFILE_CUSTOM, the behavior of the device will not change but future calls to libinput_device_config_accel_get_speed() will reflect the updated speed setting.
- Parameters
-
device The device to configure
- Returns
- The current speed, range -1 to 1
◆ 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
◆ 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 | profile | ||
) |
Set the pointer acceleration profile of this pointer device to the given mode.
- Parameters
-
device The device to configure profile The profile to set the device to.
- Returns
- A config status code
- Since
- 1.1
◆ 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
◆ libinput_device_config_area_get_default_rectangle()
struct libinput_config_area_rectangle libinput_device_config_area_get_default_rectangle | ( | struct libinput_device * | device | ) |
Return the default area rectangle for this device.
The return value for a device that does not support area rectangles is a rectangle with the points 0/0 and 1/1.
- Note
- It is an application bug to call this function for devices where libinput_device_config_area_has_rectangle() returns 0.
- Parameters
-
device The device to check
- Returns
- The default area rectangle
◆ libinput_device_config_area_get_rectangle()
struct libinput_config_area_rectangle libinput_device_config_area_get_rectangle | ( | struct libinput_device * | device | ) |
Return the current area rectangle for this device.
The return value for a device that does not support area rectangles is a rectangle with the points 0/0 and 1/1.
- Note
- It is an application bug to call this function for devices where libinput_device_config_area_has_rectangle() returns 0.
- Parameters
-
device The device to check
- Returns
- The current area rectangle
◆ libinput_device_config_area_has_rectangle()
int libinput_device_config_area_has_rectangle | ( | struct libinput_device * | device | ) |
Check if the device can change its logical input area via a rectangle.
- Parameters
-
device The device to check
- Returns
- Non-zero if the device can be calibrated, zero otherwise.
◆ libinput_device_config_area_set_rectangle()
enum libinput_config_status libinput_device_config_area_set_rectangle | ( | struct libinput_device * | device, |
const struct libinput_config_area_rectangle * | rect | ||
) |
Set the given rectangle as the logical input area of this device.
Future interactions by a tablet tool on this devices are scaled to only consider events within this logical input area - as if the logical input area were the available physical area.
The coordinates of the rectangle represent the proportion of the available maximum physical area, normalized to the range [0.0, 1.0]. For example, a rectangle with the two points 0.25, 0.5, 0.75, 1.0 adds a 25% dead zone to the left and right and a 50% dead zone on the top:
The area applies in the tablet's current logical rotation, i.e. the above example is always at the bottom of the tablet.
Once applied, the logical area's top-left coordinate (in the current logical rotation) becomes the new offset (0/0) and the return values of libinput_event_tablet_tool_get_x() and libinput_event_tablet_tool_get_y() are in relation to this new offset.
Likewise, libinput_event_tablet_tool_get_x_transformed() and libinput_event_tablet_tool_get_y_transformed() represent the value scaled into the configured logical area.
The return value of libinput_device_get_size() is not affected by the configured area.
Changing the area may not take effect immediately, the device may wait until it is in a neutral state before applying any changes.
- Parameters
-
device The device to check rect The intended rectangle
- Returns
- A config status code. Setting the area on a device that does not support area rectangles always fails with LIBINPUT_CONFIG_STATUS_UNSUPPORTED.
◆ 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 the libinput documentation for more details.
- 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
◆ 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
◆ 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.
◆ 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
The translation component (c, f) is expected to be normalized to the device coordinate range. For example, the matrix
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
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:
- 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.
◆ libinput_device_config_click_get_clickfinger_button_map()
enum libinput_config_clickfinger_button_map libinput_device_config_click_get_clickfinger_button_map | ( | struct libinput_device * | device | ) |
Get the finger number to button number mapping for clickfinger.
The return value for a device that does not support clickfinger is always LIBINPUT_CONFIG_CLICKFINGER_MAP_LRM.
- Parameters
-
device The device to configure
- Returns
- The current finger-to-button number mapping
◆ libinput_device_config_click_get_default_clickfinger_button_map()
enum libinput_config_clickfinger_button_map libinput_device_config_click_get_default_clickfinger_button_map | ( | struct libinput_device * | device | ) |
Get the default finger number to button number mapping for clickfinger.
The return value for a device that does not support clickfinger is always LIBINPUT_CONFIG_CLICKFINGER_MAP_LRM.
- Parameters
-
device The device to configure
- Returns
- The default finger-to-button number mapping
◆ 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
◆ 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
◆ 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.
◆ libinput_device_config_click_set_clickfinger_button_map()
enum libinput_config_status libinput_device_config_click_set_clickfinger_button_map | ( | struct libinput_device * | device, |
enum libinput_config_clickfinger_button_map | map | ||
) |
Set the finger number to button number mapping for clickfinger.
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.
- 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 the clickfinger method always fails with LIBINPUT_CONFIG_STATUS_UNSUPPORTED.
◆ 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
◆ 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.
◆ 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.
◆ 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 the libinput documentation for details.
- Parameters
-
device The device to configure
- Returns
- 0 if this device does not support disable-while-typing, or 1 otherwise.
◆ 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 the libinput documentation 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.
◆ libinput_device_config_dwtp_get_default_enabled()
enum libinput_config_dwtp_state libinput_device_config_dwtp_get_default_enabled | ( | struct libinput_device * | device | ) |
Check if the disable-while trackpointing feature is enabled on this device by default.
If the device does not support disable-while-trackpointing, this function returns LIBINPUT_CONFIG_DWTP_DISABLED.
- Parameters
-
device The device to configure
- Returns
- LIBINPUT_CONFIG_DWTP_DISABLED if disabled, LIBINPUT_CONFIG_DWTP_ENABLED if enabled.
- See also
- libinput_device_config_dwtp_is_available
- libinput_device_config_dwtp_set_enabled
- libinput_device_config_dwtp_get_enabled
- Since
- 1.21
◆ libinput_device_config_dwtp_get_enabled()
enum libinput_config_dwtp_state libinput_device_config_dwtp_get_enabled | ( | struct libinput_device * | device | ) |
Check if the disable-while trackpointing feature is currently enabled on this device.
If the device does not support disable-while-trackpointing, this function returns LIBINPUT_CONFIG_DWTP_DISABLED.
- Parameters
-
device The device to configure
- Returns
- LIBINPUT_CONFIG_DWTP_DISABLED if disabled, LIBINPUT_CONFIG_DWTP_ENABLED if enabled.
- See also
- libinput_device_config_dwtp_is_available
- libinput_device_config_dwtp_set_enabled
- libinput_device_config_dwtp_get_default_enabled
- Since
- 1.21
◆ libinput_device_config_dwtp_is_available()
int libinput_device_config_dwtp_is_available | ( | struct libinput_device * | device | ) |
Check if this device supports configurable disable-while-trackpointing feature.
This feature is usually available on Thinkpads and disables the touchpad while using the trackpoint. See the libinput documentation for details.
- Parameters
-
device The device to configure
- Returns
- 0 if this device does not support disable-while-trackpointing, or 1 otherwise.
- See also
- libinput_device_config_dwtp_set_enabled
- libinput_device_config_dwtp_get_enabled
- libinput_device_config_dwtp_get_default_enabled
- Since
- 1.21
◆ libinput_device_config_dwtp_set_enabled()
enum libinput_config_status libinput_device_config_dwtp_set_enabled | ( | struct libinput_device * | device, |
enum libinput_config_dwtp_state | enable | ||
) |
Enable or disable the disable-while-trackpointing feature.
When enabled, the device will be disabled while using the trackpoint and for a short period after. See the libinput documentation for details.
- Note
- Enabling or disabling disable-while-trackpointing may not take effect immediately.
- Parameters
-
device The device to configure enable LIBINPUT_CONFIG_DWTP_DISABLED to disable disable-while-trackpointing, LIBINPUT_CONFIG_DWTP_ENABLED to enable
- Returns
- A config status code. Disabling disable-while-trackpointing on a device that does not support the feature always succeeds.
- See also
- libinput_device_config_dwtp_is_available
- libinput_device_config_dwtp_get_enabled
- libinput_device_config_dwtp_get_default_enabled
- Since
- 1.21
◆ 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
◆ 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
◆ 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
◆ 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
◆ 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 libinput_device_config_middle_emulation_set_enabled() for more 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.
◆ 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 libinput_device_config_middle_emulation_set_enabled() for more 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.
◆ 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 libinput_device_config_middle_emulation_set_enabled() for more 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.
◆ 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 the libinput documentation for more 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.
◆ 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
- Since
- 1.4
◆ 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
- Since
- 1.4
◆ 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
- Since
- 1.4
◆ 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.
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
- Since
- 1.4
◆ 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
◆ libinput_device_config_scroll_get_button_lock()
enum libinput_config_scroll_button_lock_state libinput_device_config_scroll_get_button_lock | ( | struct libinput_device * | device | ) |
Get the current scroll button lock state.
If LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN scroll method is not supported, or no button is set, this function returns LIBINPUT_CONFIG_SCROLL_BUTTON_LOCK_DISABLED.
- Note
- The return value is independent of the currently selected scroll-method. For the scroll button lock 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 scroll button lock state
◆ 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
◆ libinput_device_config_scroll_get_default_button_lock()
enum libinput_config_scroll_button_lock_state libinput_device_config_scroll_get_default_button_lock | ( | struct libinput_device * | device | ) |
Get the default scroll button lock state.
If LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN scroll method is not supported, or no button is set, this function returns LIBINPUT_CONFIG_SCROLL_BUTTON_LOCK_DISABLED.
- Parameters
-
device The device to configure
- Returns
- The default scroll button lock state
◆ 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.
◆ 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
◆ 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.
◆ 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.
◆ 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
◆ 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
◆ 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
◆ libinput_device_config_scroll_set_button_lock()
enum libinput_config_status libinput_device_config_scroll_set_button_lock | ( | struct libinput_device * | device, |
enum libinput_config_scroll_button_lock_state | state | ||
) |
Set the scroll button lock.
If the state is LIBINPUT_CONFIG_SCROLL_BUTTON_LOCK_DISABLED, the button must physically be held down for button scrolling to work. If the state is LIBINPUT_CONFIG_SCROLL_BUTTON_LOCK_ENABLED, the button is considered logically down after the first press and release sequence, and logically up after the second press and release sequence.
- Parameters
-
device The device to configure state The state to set the scroll button lock to
- Returns
- A config status code. Disabling the scroll button lock on device that does not support button scrolling always succeeds.
◆ 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.
◆ 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
◆ 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.
◆ 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.
◆ 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.
◆ 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.
◆ 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
- Since
- 1.5
◆ 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
- Since
- 1.5
◆ 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
- Since
- 1.2
◆ 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 or tap-and-drag is disabled by default.
- Parameters
-
device The device to configure
- Return values
-
LIBINPUT_CONFIG_DRAG_LOCK_ENABLED_STICKY If drag lock is enabled in sticky mode by default LIBINPUT_CONFIG_DRAG_LOCK_ENABLED_TIMEOUT If drag lock is enabled in timeout mode by default LIBINPUT_CONFIG_DRAG_LOCK_DISABLED If drag lock is disabled by default
◆ 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
◆ 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_set_drag_enabled
- libinput_device_config_tap_get_default_default_enabled
- Since
- 1.2
◆ 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 or tap-and-drag is disabled.
- Parameters
-
device The device to configure
- Return values
-
LIBINPUT_CONFIG_DRAG_LOCK_ENABLED_STICKY If drag lock is currently enabled in sticky mode LIBINPUT_CONFIG_DRAG_LOCK_ENABLED_TIMEOUT If drag lock is currently enabled in timeout mode LIBINPUT_CONFIG_DRAG_LOCK_DISABLED If drag lock is currently disabled
◆ 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
◆ 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.
◆ 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.
- Since
- 1.5
◆ 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 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 the libinput documentation 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_get_drag_enabled
- libinput_device_config_tap_get_default_drag_enabled
- Since
- 1.2
◆ 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 and the drag process continues. A timeout for lifting the finger is optional. When disabled, lifting the finger during a tap-and-drag will immediately stop the drag. See the libinput documentation for more details.
Enabling drag lock on a device that has tapping or tap-and-drag disabled is permitted, but has no effect until tapping and tap-and-drag are enabled.
- Parameters
-
device The device to configure enable LIBINPUT_CONFIG_DRAG_LOCK_ENABLED_STICKY to enable drag lock in sticky mode, LIBINPUT_CONFIG_DRAG_LOCK_ENABLED_TIMEOUT to enable drag lock in timeout mode, 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.
◆ 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.
◆ libinput_tablet_tool_config_pressure_range_get_default_maximum()
double libinput_tablet_tool_config_pressure_range_get_default_maximum | ( | struct libinput_tablet_tool * | tool | ) |
Get the maximum pressure value for this tablet tool, normalized to the range [0.0, 1.0] of the available hardware pressure.
If the tool does not support pressure range configuration, the return value of this function is always 1.0.
- Parameters
-
tool The libinput tool
- Returns
- The maximum pressure value for this tablet tool
- See also
- libinput_tablet_tool_config_pressure_range_is_available
- libinput_tablet_tool_config_pressure_range_get_maximum
- libinput_tablet_tool_config_pressure_range_get_maximum
- libinput_tablet_tool_config_pressure_range_get_default_maximum
- Since
- 1.26
◆ libinput_tablet_tool_config_pressure_range_get_default_minimum()
double libinput_tablet_tool_config_pressure_range_get_default_minimum | ( | struct libinput_tablet_tool * | tool | ) |
Get the minimum pressure value for this tablet tool, normalized to the range [0.0, 1.0] of the available hardware pressure.
If the tool does not support pressure range configuration, the return value of this function is always 0.0.
- Parameters
-
tool The libinput tool
- Returns
- The minimum pressure value for this tablet tool
- See also
- libinput_tablet_tool_config_pressure_range_is_available
- libinput_tablet_tool_config_pressure_range_get_minimum
- libinput_tablet_tool_config_pressure_range_get_maximum
- libinput_tablet_tool_config_pressure_range_get_default_maximum
- Since
- 1.26
◆ libinput_tablet_tool_config_pressure_range_get_maximum()
double libinput_tablet_tool_config_pressure_range_get_maximum | ( | struct libinput_tablet_tool * | tool | ) |
Get the maximum pressure value for this tablet tool, normalized to the range [0.0, 1.0] of the available hardware pressure.
If the tool does not support pressure range configuration, the return value of this function is always 1.0.
- Parameters
-
tool The libinput tool
- Returns
- The maximum pressure value for this tablet tool
- See also
- libinput_tablet_tool_config_pressure_range_is_available
- libinput_tablet_tool_config_pressure_range_get_minimum
- libinput_tablet_tool_config_pressure_range_get_default_maximum
- libinput_tablet_tool_config_pressure_range_get_default_maximum
- Since
- 1.26
◆ libinput_tablet_tool_config_pressure_range_get_minimum()
double libinput_tablet_tool_config_pressure_range_get_minimum | ( | struct libinput_tablet_tool * | tool | ) |
Get the minimum pressure value for this tablet tool, normalized to the range [0.0, 1.0] of the available hardware pressure.
If the tool does not support pressure range configuration, the return value of this function is always 0.0.
- Parameters
-
tool The libinput tool
- Returns
- The minimum pressure value for this tablet tool
- See also
- libinput_tablet_tool_config_pressure_range_is_available
- libinput_tablet_tool_config_pressure_range_get_maximum
- libinput_tablet_tool_config_pressure_range_get_default_minimum
- libinput_tablet_tool_config_pressure_range_get_default_maximum
- Since
- 1.26
◆ libinput_tablet_tool_config_pressure_range_is_available()
int libinput_tablet_tool_config_pressure_range_is_available | ( | struct libinput_tablet_tool * | tool | ) |
Check if a tablet tool can have a custom pressure range.
- Parameters
-
tool The libinput tool
- Returns
- Non-zero if a device has an adjustible pressure range, zero otherwise.
- See also
- libinput_tablet_tool_config_pressure_range_set
- libinput_tablet_tool_config_pressure_range_get_minimum
- libinput_tablet_tool_config_pressure_range_get_maximum
- libinput_tablet_tool_config_pressure_range_get_default_minimum
- libinput_tablet_tool_config_pressure_range_get_default_maximum
- Since
- 1.26
◆ libinput_tablet_tool_config_pressure_range_set()
enum libinput_config_status libinput_tablet_tool_config_pressure_range_set | ( | struct libinput_tablet_tool * | tool, |
double | minimum, | ||
double | maximum | ||
) |
Set the pressure range for this tablet tool.
This maps the given logical pressure range into the available hardware pressure range so that a hardware pressure of the given minimum value maps into a logical pressure of 0.0 (as returned by libinput_event_tablet_tool_get_pressure()) and the hardware pressure of the given maximum value is mapped into the logical pressure of 1.0 (as returned by libinput_event_tablet_tool_get_pressure())
The minimum value must be less than the maximum value, libinput may require the values to have a specific distance to each other, i.e. that (maximum - minimum > N) for an implementation-defined value of N.
- Parameters
-
tool The libinput tool minimum The minimum pressure value in the range [0.0, 1.0) maximum The maximum pressure value in the range (0.0, 1.0]
- Returns
- A config status code
- See also
- libinput_tablet_tool_config_pressure_range_is_available
- libinput_tablet_tool_config_pressure_range_get_minimum
- libinput_tablet_tool_config_pressure_range_get_maximum
- libinput_tablet_tool_config_pressure_range_get_default_minimum
- libinput_tablet_tool_config_pressure_range_get_default_maximum
- Since
- 1.26