Enable, disable, change and/or check for device-specific features. 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_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... | |
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.
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.
Enumeration Type Documentation
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. |
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. |
Possible states for the disable-while-typing feature.
See Disable-while-typing for details.
Enumerator | |
---|---|
LIBINPUT_CONFIG_DWT_DISABLED | |
LIBINPUT_CONFIG_DWT_ENABLED |
The scroll method of a device selects when to generate scroll axis events instead of pointer motion events.
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. |
Function Documentation
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.
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.
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.
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.
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.
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
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
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
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
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
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
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.
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.
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
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
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.
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
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.
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.
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.
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.
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
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
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
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
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.
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.
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.
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.
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 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.
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.
The middle button release event may be generated when either button is released, or when both buttons have been released. The exact behavior is device-dependent.
The middle button emulation behavior when combined with other device buttons, including a physical middle button is device-dependent.
- Note
- Some devices provide middle mouse button emulation but do not allow enabling/disabling that emulation.
- 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.
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
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
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.
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_has_natural_scroll
- libinput_device_config_set_natural_scroll_enabled
- libinput_device_config_get_natural_scroll_enabled
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.
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.
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_has_natural_scroll
- libinput_device_config_set_natural_scroll_enabled
- libinput_device_config_get_default_natural_scroll_enabled
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_set_natural_scroll_enabled
- libinput_device_config_get_natural_scroll_enabled
- libinput_device_config_get_default_natural_scroll_enabled
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
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.
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_has_natural_scroll
- libinput_device_config_get_natural_scroll_enabled
- libinput_device_config_get_default_natural_scroll_enabled
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.
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.
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.
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.
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
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
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
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
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
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
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.
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
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.
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.