Disabling and enabling devices

Enumerations

enum  libinput_config_send_events_mode { LIBINPUT_CONFIG_SEND_EVENTS_ENABLED, LIBINPUT_CONFIG_SEND_EVENTS_DISABLED, LIBINPUT_CONFIG_SEND_EVENTS_DISABLED_ON_EXTERNAL_MOUSE }
 The send-event mode of a device defines when a device may generate events and pass those events to the caller. More...
 

Functions

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...
 

Detailed Description

Enumeration Type Documentation

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

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
deviceThe device to configure
Returns
The bitmask of the send-event mode for this device.
See also
libinput_device_config_send_events_get_modes
libinput_device_config_send_events_set_mode
libinput_device_config_send_events_get_mode
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
deviceThe device to configure
Returns
The current bitmask of the send-event mode for this device.
See also
libinput_device_config_send_events_get_modes
libinput_device_config_send_events_set_mode
libinput_device_config_send_events_get_default_mode
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
deviceThe device to configure
Returns
A bitmask of possible modes.
See also
libinput_device_config_send_events_set_mode
libinput_device_config_send_events_get_mode
libinput_device_config_send_events_get_default_mode
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
deviceThe device to configure
modeA bitmask of send-events modes
Returns
A config status code.
See also
libinput_device_config_send_events_get_modes
libinput_device_config_send_events_get_mode
libinput_device_config_send_events_get_default_mode