Loading [MathJax]/extensions/tex2jax.js
libinput.h File Reference
#include <stdlib.h>
#include <stdint.h>
#include <stdarg.h>
#include <libudev.h>

Go to the source code of this file.

Data Structures

struct  libinput_interface
 libinput does not open file descriptors to devices directly, instead open_restricted() and close_restricted() are called for each path that must be opened. More...
 

Macros

#define LIBINPUT_ATTRIBUTE_PRINTF(_format, _args)
 
#define LIBINPUT_ATTRIBUTE_DEPRECATED
 

Typedefs

typedef void(* libinput_log_handler) (struct libinput *libinput, enum libinput_log_priority priority, const char *format, va_list args) LIBINPUT_ATTRIBUTE_PRINTF(3
 Log handler type for custom logging. More...
 
typedef void(*) voi libinput_log_set_handler) (struct libinput *libinput, libinput_log_handler log_handler)
 Set the context's log handler. More...
 

Enumerations

enum  libinput_log_priority { LIBINPUT_LOG_PRIORITY_DEBUG, LIBINPUT_LOG_PRIORITY_INFO, LIBINPUT_LOG_PRIORITY_ERROR }
 Log priority for internal logging messages. More...
 
enum  libinput_device_capability {
  LIBINPUT_DEVICE_CAP_KEYBOARD, LIBINPUT_DEVICE_CAP_POINTER, LIBINPUT_DEVICE_CAP_TOUCH, LIBINPUT_DEVICE_CAP_TABLET_TOOL,
  LIBINPUT_DEVICE_CAP_TABLET_PAD, LIBINPUT_DEVICE_CAP_GESTURE, LIBINPUT_DEVICE_CAP_SWITCH
}
 Capabilities on a device. More...
 
enum  libinput_key_state { LIBINPUT_KEY_STATE_RELEASED, LIBINPUT_KEY_STATE_PRESSED }
 Logical state of a key. More...
 
enum  libinput_led { LIBINPUT_LED_NUM_LOCK, LIBINPUT_LED_CAPS_LOCK, LIBINPUT_LED_SCROLL_LOCK }
 Mask reflecting LEDs on a device. More...
 
enum  libinput_button_state { LIBINPUT_BUTTON_STATE_RELEASED, LIBINPUT_BUTTON_STATE_PRESSED }
 Logical state of a physical button. More...
 
enum  libinput_pointer_axis { LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL, LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL }
 Axes on a device with the capability LIBINPUT_DEVICE_CAP_POINTER that are not x or y coordinates. More...
 
enum  libinput_pointer_axis_source { LIBINPUT_POINTER_AXIS_SOURCE_WHEEL, LIBINPUT_POINTER_AXIS_SOURCE_FINGER, LIBINPUT_POINTER_AXIS_SOURCE_CONTINUOUS, LIBINPUT_POINTER_AXIS_SOURCE_WHEEL_TILT }
 The source for a libinput_pointer_axis event. More...
 
enum  libinput_tablet_pad_ring_axis_source { LIBINPUT_TABLET_PAD_RING_SOURCE_UNKNOWN, LIBINPUT_TABLET_PAD_RING_SOURCE_FINGER }
 The source for a LIBINPUT_EVENT_TABLET_PAD_RING event. More...
 
enum  libinput_tablet_pad_strip_axis_source { LIBINPUT_TABLET_PAD_STRIP_SOURCE_UNKNOWN, LIBINPUT_TABLET_PAD_STRIP_SOURCE_FINGER }
 The source for a LIBINPUT_EVENT_TABLET_PAD_STRIP event. More...
 
enum  libinput_tablet_tool_type {
  LIBINPUT_TABLET_TOOL_TYPE_PEN, LIBINPUT_TABLET_TOOL_TYPE_ERASER, LIBINPUT_TABLET_TOOL_TYPE_BRUSH, LIBINPUT_TABLET_TOOL_TYPE_PENCIL,
  LIBINPUT_TABLET_TOOL_TYPE_AIRBRUSH, LIBINPUT_TABLET_TOOL_TYPE_MOUSE, LIBINPUT_TABLET_TOOL_TYPE_LENS
}
 Available tool types for a device with the LIBINPUT_DEVICE_CAP_TABLET_TOOL capability. More...
 
enum  libinput_tablet_tool_proximity_state { LIBINPUT_TABLET_TOOL_PROXIMITY_STATE_OUT, LIBINPUT_TABLET_TOOL_PROXIMITY_STATE_IN }
 The state of proximity for a tool on a device. More...
 
enum  libinput_tablet_tool_tip_state { LIBINPUT_TABLET_TOOL_TIP_UP, LIBINPUT_TABLET_TOOL_TIP_DOWN }
 The tip contact state for a tool on a device. More...
 
enum  libinput_switch_state { LIBINPUT_SWITCH_STATE_OFF, LIBINPUT_SWITCH_STATE_ON }
 The state of a switch. More...
 
enum  libinput_switch { LIBINPUT_SWITCH_LID, LIBINPUT_SWITCH_TABLET_MODE }
 The type of a switch. More...
 
enum  libinput_event_type {
  LIBINPUT_EVENT_NONE, LIBINPUT_EVENT_DEVICE_ADDED, LIBINPUT_EVENT_DEVICE_REMOVED, LIBINPUT_EVENT_KEYBOARD_KEY,
  LIBINPUT_EVENT_POINTER_MOTION, LIBINPUT_EVENT_POINTER_MOTION_ABSOLUTE, LIBINPUT_EVENT_POINTER_BUTTON, LIBINPUT_EVENT_POINTER_AXIS,
  LIBINPUT_EVENT_TOUCH_DOWN, LIBINPUT_EVENT_TOUCH_UP, LIBINPUT_EVENT_TOUCH_MOTION, LIBINPUT_EVENT_TOUCH_CANCEL,
  LIBINPUT_EVENT_TOUCH_FRAME, LIBINPUT_EVENT_TABLET_TOOL_AXIS, LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, LIBINPUT_EVENT_TABLET_TOOL_TIP,
  LIBINPUT_EVENT_TABLET_TOOL_BUTTON, LIBINPUT_EVENT_TABLET_PAD_BUTTON, LIBINPUT_EVENT_TABLET_PAD_RING, LIBINPUT_EVENT_TABLET_PAD_STRIP,
  LIBINPUT_EVENT_GESTURE_SWIPE_BEGIN, LIBINPUT_EVENT_GESTURE_SWIPE_UPDATE, LIBINPUT_EVENT_GESTURE_SWIPE_END, LIBINPUT_EVENT_GESTURE_PINCH_BEGIN,
  LIBINPUT_EVENT_GESTURE_PINCH_UPDATE, LIBINPUT_EVENT_GESTURE_PINCH_END, LIBINPUT_EVENT_SWITCH_TOGGLE
}
 Event type for events returned by libinput_get_event(). More...
 
enum  libinput_config_status { LIBINPUT_CONFIG_STATUS_SUCCESS, LIBINPUT_CONFIG_STATUS_UNSUPPORTED, LIBINPUT_CONFIG_STATUS_INVALID }
 Status codes returned when applying configuration settings. More...
 
enum  libinput_config_tap_state { LIBINPUT_CONFIG_TAP_DISABLED, LIBINPUT_CONFIG_TAP_ENABLED }
 
enum  libinput_config_tap_button_map { LIBINPUT_CONFIG_TAP_MAP_LRM, LIBINPUT_CONFIG_TAP_MAP_LMR }
 
enum  libinput_config_drag_state { LIBINPUT_CONFIG_DRAG_DISABLED, LIBINPUT_CONFIG_DRAG_ENABLED }
 A config status to distinguish or set dragging on a device. More...
 
enum  libinput_config_drag_lock_state { LIBINPUT_CONFIG_DRAG_LOCK_DISABLED, LIBINPUT_CONFIG_DRAG_LOCK_ENABLED }
 
enum  libinput_config_send_events_mode { LIBINPUT_CONFIG_SEND_EVENTS_ENABLED, LIBINPUT_CONFIG_SEND_EVENTS_DISABLED, LIBINPUT_CONFIG_SEND_EVENTS_DISABLED_ON_EXTERNAL_MOUSE }
 The send-event mode of a device defines when a device may generate events and pass those events to the caller. More...
 
enum  libinput_config_accel_profile { LIBINPUT_CONFIG_ACCEL_PROFILE_NONE, LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT, LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE }
 
enum  libinput_config_click_method { LIBINPUT_CONFIG_CLICK_METHOD_NONE, LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS, LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER }
 The click method defines when to generate software-emulated buttons, usually on a device that does not have a specific physical button available. More...
 
enum  libinput_config_middle_emulation_state { LIBINPUT_CONFIG_MIDDLE_EMULATION_DISABLED, LIBINPUT_CONFIG_MIDDLE_EMULATION_ENABLED }
 
enum  libinput_config_scroll_method { LIBINPUT_CONFIG_SCROLL_NO_SCROLL, LIBINPUT_CONFIG_SCROLL_2FG, LIBINPUT_CONFIG_SCROLL_EDGE, LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN }
 The scroll method of a device selects when to generate scroll axis events instead of pointer motion events. More...
 
enum  libinput_config_dwt_state { LIBINPUT_CONFIG_DWT_DISABLED, LIBINPUT_CONFIG_DWT_ENABLED }
 Possible states for the disable-while-typing feature. More...
 

Functions

int libinput_device_tablet_pad_get_num_mode_groups (struct libinput_device *device)
 Most devices only provide a single mode group, however devices such as the Wacom Cintiq 22HD provide two mode groups. More...
 
struct libinput_tablet_pad_mode_grouplibinput_device_tablet_pad_get_mode_group (struct libinput_device *device, unsigned int index)
 The returned mode group is not refcounted and may become invalid after the next call to libinput. More...
 
unsigned int libinput_tablet_pad_mode_group_get_index (struct libinput_tablet_pad_mode_group *group)
 The returned number is the same index as passed to libinput_device_tablet_pad_get_mode_group(). More...
 
unsigned int libinput_tablet_pad_mode_group_get_num_modes (struct libinput_tablet_pad_mode_group *group)
 Query the mode group for the number of available modes. More...
 
unsigned int libinput_tablet_pad_mode_group_get_mode (struct libinput_tablet_pad_mode_group *group)
 Return the current mode this mode group is in. More...
 
int libinput_tablet_pad_mode_group_has_button (struct libinput_tablet_pad_mode_group *group, unsigned int button)
 Devices without mode switching capabilities return true for every button. More...
 
int libinput_tablet_pad_mode_group_has_ring (struct libinput_tablet_pad_mode_group *group, unsigned int ring)
 Devices without mode switching capabilities return true for every ring. More...
 
int libinput_tablet_pad_mode_group_has_strip (struct libinput_tablet_pad_mode_group *group, unsigned int strip)
 Devices without mode switching capabilities return true for every strip. More...
 
int libinput_tablet_pad_mode_group_button_is_toggle (struct libinput_tablet_pad_mode_group *group, unsigned int button)
 The toggle button in a mode group is the button assigned to cycle to or directly assign a new mode when pressed. More...
 
struct libinput_tablet_pad_mode_grouplibinput_tablet_pad_mode_group_ref (struct libinput_tablet_pad_mode_group *group)
 Increase the refcount of the mode group. More...
 
struct libinput_tablet_pad_mode_grouplibinput_tablet_pad_mode_group_unref (struct libinput_tablet_pad_mode_group *group)
 Decrease the refcount of the mode group. More...
 
void libinput_tablet_pad_mode_group_set_user_data (struct libinput_tablet_pad_mode_group *group, void *user_data)
 Set caller-specific data associated with this mode group. More...
 
void * libinput_tablet_pad_mode_group_get_user_data (struct libinput_tablet_pad_mode_group *group)
 Get the caller-specific data associated with this mode group, if any. More...
 
void libinput_event_destroy (struct libinput_event *event)
 Destroy the event, freeing all associated resources. More...
 
enum libinput_event_type libinput_event_get_type (struct libinput_event *event)
 Get the type of the event. More...
 
struct libinputlibinput_event_get_context (struct libinput_event *event)
 Get the libinput context from the event. More...
 
struct libinput_devicelibinput_event_get_device (struct libinput_event *event)
 Return the device associated with this event. More...
 
struct libinput_event_pointerlibinput_event_get_pointer_event (struct libinput_event *event)
 Return the pointer event that is this input event. More...
 
struct libinput_event_keyboardlibinput_event_get_keyboard_event (struct libinput_event *event)
 Return the keyboard event that is this input event. More...
 
struct libinput_event_touchlibinput_event_get_touch_event (struct libinput_event *event)
 Return the touch event that is this input event. More...
 
struct libinput_event_gesture * libinput_event_get_gesture_event (struct libinput_event *event)
 Return the gesture event that is this input event. More...
 
struct libinput_event_tablet_toollibinput_event_get_tablet_tool_event (struct libinput_event *event)
 Return the tablet tool event that is this input event. More...
 
struct libinput_event_tablet_padlibinput_event_get_tablet_pad_event (struct libinput_event *event)
 Return the tablet pad event that is this input event. More...
 
struct libinput_event_switchlibinput_event_get_switch_event (struct libinput_event *event)
 Return the switch event that is this input event. More...
 
struct libinput_event_device_notifylibinput_event_get_device_notify_event (struct libinput_event *event)
 Return the device event that is this input event. More...
 
struct libinput_eventlibinput_event_device_notify_get_base_event (struct libinput_event_device_notify *event)
 
uint32_t libinput_event_keyboard_get_time (struct libinput_event_keyboard *event)
 
uint64_t libinput_event_keyboard_get_time_usec (struct libinput_event_keyboard *event)
 
uint32_t libinput_event_keyboard_get_key (struct libinput_event_keyboard *event)
 
enum libinput_key_state libinput_event_keyboard_get_key_state (struct libinput_event_keyboard *event)
 
struct libinput_eventlibinput_event_keyboard_get_base_event (struct libinput_event_keyboard *event)
 
uint32_t libinput_event_keyboard_get_seat_key_count (struct libinput_event_keyboard *event)
 For the key of a LIBINPUT_EVENT_KEYBOARD_KEY event, return the total number of keys pressed on all devices on the associated seat after the event was triggered. More...
 
uint32_t libinput_event_pointer_get_time (struct libinput_event_pointer *event)
 
uint64_t libinput_event_pointer_get_time_usec (struct libinput_event_pointer *event)
 
double libinput_event_pointer_get_dx (struct libinput_event_pointer *event)
 Return the delta between the last event and the current event. More...
 
double libinput_event_pointer_get_dy (struct libinput_event_pointer *event)
 Return the delta between the last event and the current event. More...
 
double libinput_event_pointer_get_dx_unaccelerated (struct libinput_event_pointer *event)
 Return the relative delta of the unaccelerated motion vector of the current event. More...
 
double libinput_event_pointer_get_dy_unaccelerated (struct libinput_event_pointer *event)
 Return the relative delta of the unaccelerated motion vector of the current event. More...
 
double libinput_event_pointer_get_absolute_x (struct libinput_event_pointer *event)
 Return the current absolute x coordinate of the pointer event, in mm from the top left corner of the device. More...
 
double libinput_event_pointer_get_absolute_y (struct libinput_event_pointer *event)
 Return the current absolute y coordinate of the pointer event, in mm from the top left corner of the device. More...
 
double libinput_event_pointer_get_absolute_x_transformed (struct libinput_event_pointer *event, uint32_t width)
 Return the current absolute x coordinate of the pointer event, transformed to screen coordinates. More...
 
double libinput_event_pointer_get_absolute_y_transformed (struct libinput_event_pointer *event, uint32_t height)
 Return the current absolute y coordinate of the pointer event, transformed to screen coordinates. More...
 
uint32_t libinput_event_pointer_get_button (struct libinput_event_pointer *event)
 Return the button that triggered this event. More...
 
enum libinput_button_state libinput_event_pointer_get_button_state (struct libinput_event_pointer *event)
 Return the button state that triggered this event. More...
 
uint32_t libinput_event_pointer_get_seat_button_count (struct libinput_event_pointer *event)
 For the button of a LIBINPUT_EVENT_POINTER_BUTTON event, return the total number of buttons pressed on all devices on the associated seat after the event was triggered. More...
 
int libinput_event_pointer_has_axis (struct libinput_event_pointer *event, enum libinput_pointer_axis axis)
 Check if the event has a valid value for the given axis. More...
 
double libinput_event_pointer_get_axis_value (struct libinput_event_pointer *event, enum libinput_pointer_axis axis)
 Return the axis value of the given axis. More...
 
enum libinput_pointer_axis_source libinput_event_pointer_get_axis_source (struct libinput_event_pointer *event)
 Return the source for a given axis event. More...
 
double libinput_event_pointer_get_axis_value_discrete (struct libinput_event_pointer *event, enum libinput_pointer_axis axis)
 Return the axis value in discrete steps for a given axis event. More...
 
struct libinput_eventlibinput_event_pointer_get_base_event (struct libinput_event_pointer *event)
 
uint32_t libinput_event_touch_get_time (struct libinput_event_touch *event)
 
uint64_t libinput_event_touch_get_time_usec (struct libinput_event_touch *event)
 
int32_t libinput_event_touch_get_slot (struct libinput_event_touch *event)
 Get the slot of this touch event. More...
 
int32_t libinput_event_touch_get_seat_slot (struct libinput_event_touch *event)
 Get the seat slot of the touch event. More...
 
double libinput_event_touch_get_x (struct libinput_event_touch *event)
 Return the current absolute x coordinate of the touch event, in mm from the top left corner of the device. More...
 
double libinput_event_touch_get_y (struct libinput_event_touch *event)
 Return the current absolute y coordinate of the touch event, in mm from the top left corner of the device. More...
 
double libinput_event_touch_get_x_transformed (struct libinput_event_touch *event, uint32_t width)
 Return the current absolute x coordinate of the touch event, transformed to screen coordinates. More...
 
double libinput_event_touch_get_y_transformed (struct libinput_event_touch *event, uint32_t height)
 Return the current absolute y coordinate of the touch event, transformed to screen coordinates. More...
 
struct libinput_eventlibinput_event_touch_get_base_event (struct libinput_event_touch *event)
 
uint32_t libinput_event_gesture_get_time (struct libinput_event_gesture *event)
 
uint64_t libinput_event_gesture_get_time_usec (struct libinput_event_gesture *event)
 
struct libinput_eventlibinput_event_gesture_get_base_event (struct libinput_event_gesture *event)
 
int libinput_event_gesture_get_finger_count (struct libinput_event_gesture *event)
 Return the number of fingers used for a gesture. More...
 
int libinput_event_gesture_get_cancelled (struct libinput_event_gesture *event)
 Return if the gesture ended normally, or if it was cancelled. More...
 
double libinput_event_gesture_get_dx (struct libinput_event_gesture *event)
 Return the delta between the last event and the current event. More...
 
double libinput_event_gesture_get_dy (struct libinput_event_gesture *event)
 Return the delta between the last event and the current event. More...
 
double libinput_event_gesture_get_dx_unaccelerated (struct libinput_event_gesture *event)
 Return the relative delta of the unaccelerated motion vector of the current event. More...
 
double libinput_event_gesture_get_dy_unaccelerated (struct libinput_event_gesture *event)
 Return the relative delta of the unaccelerated motion vector of the current event. More...
 
double libinput_event_gesture_get_scale (struct libinput_event_gesture *event)
 Return the absolute scale of a pinch gesture, the scale is the division of the current distance between the fingers and the distance at the start of the gesture. More...
 
double libinput_event_gesture_get_angle_delta (struct libinput_event_gesture *event)
 Return the angle delta in degrees between the last and the current LIBINPUT_EVENT_GESTURE_PINCH_UPDATE event. More...
 
struct libinput_eventlibinput_event_tablet_tool_get_base_event (struct libinput_event_tablet_tool *event)
 
int libinput_event_tablet_tool_x_has_changed (struct libinput_event_tablet_tool *event)
 Check if the x axis was updated in this event. More...
 
int libinput_event_tablet_tool_y_has_changed (struct libinput_event_tablet_tool *event)
 Check if the y axis was updated in this event. More...
 
int libinput_event_tablet_tool_pressure_has_changed (struct libinput_event_tablet_tool *event)
 Check if the pressure axis was updated in this event. More...
 
int libinput_event_tablet_tool_distance_has_changed (struct libinput_event_tablet_tool *event)
 Check if the distance axis was updated in this event. More...
 
int libinput_event_tablet_tool_tilt_x_has_changed (struct libinput_event_tablet_tool *event)
 Check if the tilt x axis was updated in this event. More...
 
int libinput_event_tablet_tool_tilt_y_has_changed (struct libinput_event_tablet_tool *event)
 Check if the tilt y axis was updated in this event. More...
 
int libinput_event_tablet_tool_rotation_has_changed (struct libinput_event_tablet_tool *event)
 Check if the z-rotation axis was updated in this event. More...
 
int libinput_event_tablet_tool_slider_has_changed (struct libinput_event_tablet_tool *event)
 Check if the slider axis was updated in this event. More...
 
int libinput_event_tablet_tool_wheel_has_changed (struct libinput_event_tablet_tool *event)
 Check if the wheel axis was updated in this event. More...
 
double libinput_event_tablet_tool_get_x (struct libinput_event_tablet_tool *event)
 Returns the X coordinate of the tablet tool, in mm from the top left corner of the tablet in its current logical orientation. More...
 
double libinput_event_tablet_tool_get_y (struct libinput_event_tablet_tool *event)
 Returns the Y coordinate of the tablet tool, in mm from the top left corner of the tablet in its current logical orientation. More...
 
double libinput_event_tablet_tool_get_dx (struct libinput_event_tablet_tool *event)
 Return the delta between the last event and the current event. More...
 
double libinput_event_tablet_tool_get_dy (struct libinput_event_tablet_tool *event)
 Return the delta between the last event and the current event. More...
 
double libinput_event_tablet_tool_get_pressure (struct libinput_event_tablet_tool *event)
 Returns the current pressure being applied on the tool in use, normalized to the range [0, 1]. More...
 
double libinput_event_tablet_tool_get_distance (struct libinput_event_tablet_tool *event)
 Returns the current distance from the tablet's sensor, normalized to the range [0, 1]. More...
 
double libinput_event_tablet_tool_get_tilt_x (struct libinput_event_tablet_tool *event)
 Returns the current tilt along the X axis of the tablet's current logical orientation, in degrees off the tablet's z axis. More...
 
double libinput_event_tablet_tool_get_tilt_y (struct libinput_event_tablet_tool *event)
 Returns the current tilt along the Y axis of the tablet's current logical orientation, in degrees off the tablet's z axis. More...
 
double libinput_event_tablet_tool_get_rotation (struct libinput_event_tablet_tool *event)
 Returns the current z rotation of the tool in degrees, clockwise from the tool's logical neutral position. More...
 
double libinput_event_tablet_tool_get_slider_position (struct libinput_event_tablet_tool *event)
 Returns the current position of the slider on the tool, normalized to the range [-1, 1]. More...
 
double libinput_event_tablet_tool_get_wheel_delta (struct libinput_event_tablet_tool *event)
 Return the delta for the wheel in degrees. More...
 
int libinput_event_tablet_tool_get_wheel_delta_discrete (struct libinput_event_tablet_tool *event)
 Return the delta for the wheel in discrete steps (e.g. More...
 
double libinput_event_tablet_tool_get_x_transformed (struct libinput_event_tablet_tool *event, uint32_t width)
 Return the current absolute x coordinate of the tablet tool event, transformed to screen coordinates. More...
 
double libinput_event_tablet_tool_get_y_transformed (struct libinput_event_tablet_tool *event, uint32_t height)
 Return the current absolute y coordinate of the tablet tool event, transformed to screen coordinates. More...
 
struct libinput_tablet_toollibinput_event_tablet_tool_get_tool (struct libinput_event_tablet_tool *event)
 Returns the tool that was in use during this event. More...
 
enum libinput_tablet_tool_proximity_state libinput_event_tablet_tool_get_proximity_state (struct libinput_event_tablet_tool *event)
 Returns the new proximity state of a tool from a proximity event. More...
 
enum libinput_tablet_tool_tip_state libinput_event_tablet_tool_get_tip_state (struct libinput_event_tablet_tool *event)
 Returns the new tip state of a tool from a tip event. More...
 
uint32_t libinput_event_tablet_tool_get_button (struct libinput_event_tablet_tool *event)
 Return the button that triggered this event. More...
 
enum libinput_button_state libinput_event_tablet_tool_get_button_state (struct libinput_event_tablet_tool *event)
 Return the button state of the event. More...
 
uint32_t libinput_event_tablet_tool_get_seat_button_count (struct libinput_event_tablet_tool *event)
 
For the button of a LIBINPUT_EVENT_TABLET_TOOL_BUTTON event, return the total number of buttons pressed on all devices on the associated seat after the the event was triggered. More...
 
uint32_t libinput_event_tablet_tool_get_time (struct libinput_event_tablet_tool *event)
 
uint64_t libinput_event_tablet_tool_get_time_usec (struct libinput_event_tablet_tool *event)
 
enum libinput_tablet_tool_type libinput_tablet_tool_get_type (struct libinput_tablet_tool *tool)
 Return the tool type for a tool object, see Vendor-specific tablet tool types for details. More...
 
uint64_t libinput_tablet_tool_get_tool_id (struct libinput_tablet_tool *tool)
 Return the tool ID for a tool object. More...
 
struct libinput_tablet_toollibinput_tablet_tool_ref (struct libinput_tablet_tool *tool)
 Increment the reference count of the tool by one. More...
 
struct libinput_tablet_toollibinput_tablet_tool_unref (struct libinput_tablet_tool *tool)
 Decrement the reference count of the tool by one. More...
 
int libinput_tablet_tool_has_pressure (struct libinput_tablet_tool *tool)
 Return whether the tablet tool supports pressure. More...
 
int libinput_tablet_tool_has_distance (struct libinput_tablet_tool *tool)
 Return whether the tablet tool supports distance. More...
 
int libinput_tablet_tool_has_tilt (struct libinput_tablet_tool *tool)
 Return whether the tablet tool supports tilt. More...
 
int libinput_tablet_tool_has_rotation (struct libinput_tablet_tool *tool)
 Return whether the tablet tool supports z-rotation. More...
 
int libinput_tablet_tool_has_slider (struct libinput_tablet_tool *tool)
 Return whether the tablet tool has a slider axis. More...
 
int libinput_tablet_tool_has_wheel (struct libinput_tablet_tool *tool)
 Return whether the tablet tool has a relative wheel. More...
 
int libinput_tablet_tool_has_button (struct libinput_tablet_tool *tool, uint32_t code)
 Check if a tablet tool has a button with the passed-in code (see linux/input.h). More...
 
int libinput_tablet_tool_is_unique (struct libinput_tablet_tool *tool)
 Return nonzero if the physical tool can be uniquely identified by libinput, or nonzero otherwise. More...
 
uint64_t libinput_tablet_tool_get_serial (struct libinput_tablet_tool *tool)
 Return the serial number of a tool. More...
 
void * libinput_tablet_tool_get_user_data (struct libinput_tablet_tool *tool)
 Return the user data associated with a tool object. More...
 
void libinput_tablet_tool_set_user_data (struct libinput_tablet_tool *tool, void *user_data)
 Set the user data associated with a tool object, if any. More...
 
struct libinput_eventlibinput_event_tablet_pad_get_base_event (struct libinput_event_tablet_pad *event)
 
double libinput_event_tablet_pad_get_ring_position (struct libinput_event_tablet_pad *event)
 Returns the current position of the ring, in degrees counterclockwise from the northern-most point of the ring in the tablet's current logical orientation. More...
 
unsigned int libinput_event_tablet_pad_get_ring_number (struct libinput_event_tablet_pad *event)
 Returns the number of the ring that has changed state, with 0 being the first ring. More...
 
enum libinput_tablet_pad_ring_axis_source libinput_event_tablet_pad_get_ring_source (struct libinput_event_tablet_pad *event)
 Returns the source of the interaction with the ring. More...
 
double libinput_event_tablet_pad_get_strip_position (struct libinput_event_tablet_pad *event)
 Returns the current position of the strip, normalized to the range [0, 1], with 0 being the top/left-most point in the tablet's current logical orientation. More...
 
unsigned int libinput_event_tablet_pad_get_strip_number (struct libinput_event_tablet_pad *event)
 Returns the number of the strip that has changed state, with 0 being the first strip. More...
 
enum libinput_tablet_pad_strip_axis_source libinput_event_tablet_pad_get_strip_source (struct libinput_event_tablet_pad *event)
 Returns the source of the interaction with the strip. More...
 
uint32_t libinput_event_tablet_pad_get_button_number (struct libinput_event_tablet_pad *event)
 Return the button number that triggered this event, starting at 0. More...
 
enum libinput_button_state libinput_event_tablet_pad_get_button_state (struct libinput_event_tablet_pad *event)
 Return the button state of the event. More...
 
unsigned int libinput_event_tablet_pad_get_mode (struct libinput_event_tablet_pad *event)
 Returns the mode the button, ring, or strip that triggered this event is in, at the time of the event. More...
 
struct libinput_tablet_pad_mode_grouplibinput_event_tablet_pad_get_mode_group (struct libinput_event_tablet_pad *event)
 Returns the mode group that the button, ring, or strip that triggered this event is considered in. More...
 
uint32_t libinput_event_tablet_pad_get_time (struct libinput_event_tablet_pad *event)
 
uint64_t libinput_event_tablet_pad_get_time_usec (struct libinput_event_tablet_pad *event)
 
enum libinput_switch libinput_event_switch_get_switch (struct libinput_event_switch *event)
 Return the switch that triggered this event. More...
 
enum libinput_switch_state libinput_event_switch_get_switch_state (struct libinput_event_switch *event)
 Return the switch state that triggered this event. More...
 
struct libinput_eventlibinput_event_switch_get_base_event (struct libinput_event_switch *event)
 
uint32_t libinput_event_switch_get_time (struct libinput_event_switch *event)
 
uint64_t libinput_event_switch_get_time_usec (struct libinput_event_switch *event)
 
struct libinputlibinput_udev_create_context (const struct libinput_interface *interface, void *user_data, struct udev *udev)
 Create a new libinput context from udev. More...
 
int libinput_udev_assign_seat (struct libinput *libinput, const char *seat_id)
 Assign a seat to this libinput context. More...
 
struct libinputlibinput_path_create_context (const struct libinput_interface *interface, void *user_data)
 Create a new libinput context that requires the caller to manually add or remove devices with libinput_path_add_device() and libinput_path_remove_device(). More...
 
struct libinput_devicelibinput_path_add_device (struct libinput *libinput, const char *path)
 Add a device to a libinput context initialized with libinput_path_create_context(). More...
 
void libinput_path_remove_device (struct libinput_device *device)
 Remove a device from a libinput context initialized with libinput_path_create_context() or added to such a context with libinput_path_add_device(). More...
 
int libinput_get_fd (struct libinput *libinput)
 libinput keeps a single file descriptor for all events. More...
 
int libinput_dispatch (struct libinput *libinput)
 Main event dispatchment function. More...
 
struct libinput_eventlibinput_get_event (struct libinput *libinput)
 Retrieve the next event from libinput's internal event queue. More...
 
enum libinput_event_type libinput_next_event_type (struct libinput *libinput)
 Return the type of the next event in the internal queue. More...
 
void libinput_set_user_data (struct libinput *libinput, void *user_data)
 Set caller-specific data associated with this context. More...
 
void * libinput_get_user_data (struct libinput *libinput)
 Get the caller-specific data associated with this context, if any. More...
 
int libinput_resume (struct libinput *libinput)
 Resume a suspended libinput context. More...
 
void libinput_suspend (struct libinput *libinput)
 Suspend monitoring for new devices and close existing devices. More...
 
struct libinputlibinput_ref (struct libinput *libinput)
 Add a reference to the context. More...
 
struct libinputlibinput_unref (struct libinput *libinput)
 Dereference the libinput context. More...
 
void libinput_log_set_priority (struct libinput *libinput, enum libinput_log_priority priority)
 Set the log priority for the libinput context. More...
 
enum libinput_log_priority libinput_log_get_priority (const struct libinput *libinput)
 Get the context's log priority. More...
 
struct libinput_seatlibinput_seat_ref (struct libinput_seat *seat)
 Increase the refcount of the seat. More...
 
struct libinput_seatlibinput_seat_unref (struct libinput_seat *seat)
 Decrease the refcount of the seat. More...
 
void libinput_seat_set_user_data (struct libinput_seat *seat, void *user_data)
 Set caller-specific data associated with this seat. More...
 
void * libinput_seat_get_user_data (struct libinput_seat *seat)
 Get the caller-specific data associated with this seat, if any. More...
 
struct libinputlibinput_seat_get_context (struct libinput_seat *seat)
 Get the libinput context from the seat. More...
 
const char * libinput_seat_get_physical_name (struct libinput_seat *seat)
 Return the physical name of the seat. More...
 
const char * libinput_seat_get_logical_name (struct libinput_seat *seat)
 Return the logical name of the seat. More...
 
struct libinput_devicelibinput_device_ref (struct libinput_device *device)
 Increase the refcount of the input device. More...
 
struct libinput_devicelibinput_device_unref (struct libinput_device *device)
 Decrease the refcount of the input device. More...
 
void libinput_device_set_user_data (struct libinput_device *device, void *user_data)
 Set caller-specific data associated with this input device. More...
 
void * libinput_device_get_user_data (struct libinput_device *device)
 Get the caller-specific data associated with this input device, if any. More...
 
struct libinputlibinput_device_get_context (struct libinput_device *device)
 Get the libinput context from the device. More...
 
struct libinput_device_grouplibinput_device_get_device_group (struct libinput_device *device)
 Get the device group this device is assigned to. More...
 
const char * libinput_device_get_sysname (struct libinput_device *device)
 Get the system name of the device. More...
 
const char * libinput_device_get_name (struct libinput_device *device)
 The descriptive device name as advertised by the kernel and/or the hardware itself. More...
 
unsigned int libinput_device_get_id_product (struct libinput_device *device)
 Get the product ID for this device. More...
 
unsigned int libinput_device_get_id_vendor (struct libinput_device *device)
 Get the vendor ID for this device. More...
 
const char * libinput_device_get_output_name (struct libinput_device *device)
 A device may be mapped to a single output, or all available outputs. More...
 
struct libinput_seatlibinput_device_get_seat (struct libinput_device *device)
 Get the seat associated with this input device, see Seats for details. More...
 
int libinput_device_set_seat_logical_name (struct libinput_device *device, const char *name)
 Change the logical seat associated with this device by removing the device and adding it to the new seat. More...
 
struct udev_device * libinput_device_get_udev_device (struct libinput_device *device)
 Return a udev handle to the device that is this libinput device, if any. More...
 
void libinput_device_led_update (struct libinput_device *device, enum libinput_led leds)
 Update the LEDs on the device, if any. More...
 
int libinput_device_has_capability (struct libinput_device *device, enum libinput_device_capability capability)
 Check if the given device has the specified capability. More...
 
int libinput_device_get_size (struct libinput_device *device, double *width, double *height)
 Get the physical size of a device in mm, where meaningful. More...
 
int libinput_device_pointer_has_button (struct libinput_device *device, uint32_t code)
 Check if a LIBINPUT_DEVICE_CAP_POINTER device has a button with the given code (see linux/input.h). More...
 
int libinput_device_keyboard_has_key (struct libinput_device *device, uint32_t code)
 Check if a LIBINPUT_DEVICE_CAP_KEYBOARD device has a key with the given code (see linux/input.h). More...
 
int libinput_device_touch_get_touch_count (struct libinput_device *device)
 Check how many touches a LIBINPUT_DEVICE_CAP_TOUCH device supports simultaneously. More...
 
int libinput_device_switch_has_switch (struct libinput_device *device, enum libinput_switch sw)
 Check if a LIBINPUT_DEVICE_CAP_SWITCH device has a switch of the given type. More...
 
int libinput_device_tablet_pad_get_num_buttons (struct libinput_device *device)
 Return the number of buttons on a device with the LIBINPUT_DEVICE_CAP_TABLET_PAD capability. More...
 
int libinput_device_tablet_pad_get_num_rings (struct libinput_device *device)
 Return the number of rings a device with the LIBINPUT_DEVICE_CAP_TABLET_PAD capability provides. More...
 
int libinput_device_tablet_pad_get_num_strips (struct libinput_device *device)
 Return the number of strips a device with the LIBINPUT_DEVICE_CAP_TABLET_PAD capability provides. More...
 
struct libinput_device_grouplibinput_device_group_ref (struct libinput_device_group *group)
 Increase the refcount of the device group. More...
 
struct libinput_device_grouplibinput_device_group_unref (struct libinput_device_group *group)
 Decrease the refcount of the device group. More...
 
void libinput_device_group_set_user_data (struct libinput_device_group *group, void *user_data)
 Set caller-specific data associated with this device group. More...
 
void * libinput_device_group_get_user_data (struct libinput_device_group *group)
 Get the caller-specific data associated with this input device group, if any. More...
 
const char * libinput_config_status_to_str (enum libinput_config_status status)
 Return a string describing the error. More...
 
int libinput_device_config_tap_get_finger_count (struct libinput_device *device)
 Check if the device supports tap-to-click and how many fingers can be used for tapping. More...
 
enum libinput_config_status libinput_device_config_tap_set_enabled (struct libinput_device *device, enum libinput_config_tap_state enable)
 Enable or disable tap-to-click on this device, with a default mapping of 1, 2, 3 finger tap mapping to left, right, middle click, respectively. More...
 
enum libinput_config_tap_state libinput_device_config_tap_get_enabled (struct libinput_device *device)
 Check if tap-to-click is enabled on this device. More...
 
enum libinput_config_tap_state libinput_device_config_tap_get_default_enabled (struct libinput_device *device)
 Return the default setting for whether tap-to-click is enabled on this device. More...
 
enum libinput_config_status libinput_device_config_tap_set_button_map (struct libinput_device *device, enum libinput_config_tap_button_map map)
 Set the finger number to button number mapping for tap-to-click. More...
 
enum libinput_config_tap_button_map libinput_device_config_tap_get_button_map (struct libinput_device *device)
 Get the finger number to button number mapping for tap-to-click. More...
 
enum libinput_config_tap_button_map libinput_device_config_tap_get_default_button_map (struct libinput_device *device)
 Get the default finger number to button number mapping for tap-to-click. More...
 
enum libinput_config_status libinput_device_config_tap_set_drag_enabled (struct libinput_device *device, enum libinput_config_drag_state enable)
 Enable or disable tap-and-drag on this device. More...
 
enum libinput_config_drag_state libinput_device_config_tap_get_drag_enabled (struct libinput_device *device)
 Return whether tap-and-drag is enabled or disabled on this device. More...
 
enum libinput_config_drag_state libinput_device_config_tap_get_default_drag_enabled (struct libinput_device *device)
 Return whether tap-and-drag is enabled or disabled by default on this device. More...
 
enum libinput_config_status libinput_device_config_tap_set_drag_lock_enabled (struct libinput_device *device, enum libinput_config_drag_lock_state enable)
 Enable or disable drag-lock during tapping on this device. More...
 
enum libinput_config_drag_lock_state libinput_device_config_tap_get_drag_lock_enabled (struct libinput_device *device)
 Check if drag-lock during tapping is enabled on this device. More...
 
enum libinput_config_drag_lock_state libinput_device_config_tap_get_default_drag_lock_enabled (struct libinput_device *device)
 Check if drag-lock during tapping is enabled by default on this device. More...
 
int libinput_device_config_calibration_has_matrix (struct libinput_device *device)
 Check if the device can be calibrated via a calibration matrix. More...
 
enum libinput_config_status libinput_device_config_calibration_set_matrix (struct libinput_device *device, const float matrix[6])
 Apply the 3x3 transformation matrix to absolute device coordinates. More...
 
int libinput_device_config_calibration_get_matrix (struct libinput_device *device, float matrix[6])
 Return the current calibration matrix for this device. More...
 
int libinput_device_config_calibration_get_default_matrix (struct libinput_device *device, float matrix[6])
 Return the default calibration matrix for this device. More...
 
uint32_t libinput_device_config_send_events_get_modes (struct libinput_device *device)
 Return the possible send-event modes for this device. More...
 
enum libinput_config_status libinput_device_config_send_events_set_mode (struct libinput_device *device, uint32_t mode)
 Set the send-event mode for this device. More...
 
uint32_t libinput_device_config_send_events_get_mode (struct libinput_device *device)
 Get the send-event mode for this device. More...
 
uint32_t libinput_device_config_send_events_get_default_mode (struct libinput_device *device)
 Get the default send-event mode for this device. More...
 
int libinput_device_config_accel_is_available (struct libinput_device *device)
 Check if a device uses libinput-internal pointer-acceleration. More...
 
enum libinput_config_status libinput_device_config_accel_set_speed (struct libinput_device *device, double speed)
 Set the pointer acceleration speed of this pointer device within a range of [-1, 1], where 0 is the default acceleration for this device, -1 is the slowest acceleration and 1 is the maximum acceleration available on this device. More...
 
double libinput_device_config_accel_get_speed (struct libinput_device *device)
 Get the current pointer acceleration setting for this pointer device. More...
 
double libinput_device_config_accel_get_default_speed (struct libinput_device *device)
 Return the default speed setting for this device, normalized to a range of [-1, 1]. More...
 
uint32_t libinput_device_config_accel_get_profiles (struct libinput_device *device)
 Returns a bitmask of the configurable acceleration modes available on this device. More...
 
enum libinput_config_status libinput_device_config_accel_set_profile (struct libinput_device *device, enum libinput_config_accel_profile mode)
 Set the pointer acceleration profile of this pointer device to the given mode. More...
 
enum libinput_config_accel_profile libinput_device_config_accel_get_profile (struct libinput_device *device)
 Get the current pointer acceleration profile for this pointer device. More...
 
enum libinput_config_accel_profile libinput_device_config_accel_get_default_profile (struct libinput_device *device)
 Return the default pointer acceleration profile for this pointer device. More...
 
int libinput_device_config_scroll_has_natural_scroll (struct libinput_device *device)
 Return non-zero if the device supports "natural scrolling". More...
 
enum libinput_config_status libinput_device_config_scroll_set_natural_scroll_enabled (struct libinput_device *device, int enable)
 Enable or disable natural scrolling on the device. More...
 
int libinput_device_config_scroll_get_natural_scroll_enabled (struct libinput_device *device)
 Get the current mode for scrolling on this device. More...
 
int libinput_device_config_scroll_get_default_natural_scroll_enabled (struct libinput_device *device)
 Get the default mode for scrolling on this device. More...
 
int libinput_device_config_left_handed_is_available (struct libinput_device *device)
 Check if a device has a configuration that supports left-handed usage. More...
 
enum libinput_config_status libinput_device_config_left_handed_set (struct libinput_device *device, int left_handed)
 Set the left-handed configuration of the device. More...
 
int libinput_device_config_left_handed_get (struct libinput_device *device)
 Get the current left-handed configuration of the device. More...
 
int libinput_device_config_left_handed_get_default (struct libinput_device *device)
 Get the default left-handed configuration of the device. More...
 
uint32_t libinput_device_config_click_get_methods (struct libinput_device *device)
 Check which button click methods a device supports. More...
 
enum libinput_config_status libinput_device_config_click_set_method (struct libinput_device *device, enum libinput_config_click_method method)
 Set the button click method for this device. More...
 
enum libinput_config_click_method libinput_device_config_click_get_method (struct libinput_device *device)
 Get the button click method for this device. More...
 
enum libinput_config_click_method libinput_device_config_click_get_default_method (struct libinput_device *device)
 Get the default button click method for this device. More...
 
int libinput_device_config_middle_emulation_is_available (struct libinput_device *device)
 Check if middle mouse button emulation configuration is available on this device. More...
 
enum libinput_config_status libinput_device_config_middle_emulation_set_enabled (struct libinput_device *device, enum libinput_config_middle_emulation_state enable)
 Enable or disable middle button emulation on this device. More...
 
enum libinput_config_middle_emulation_state libinput_device_config_middle_emulation_get_enabled (struct libinput_device *device)
 Check if configurable middle button emulation is enabled on this device. More...
 
enum libinput_config_middle_emulation_state libinput_device_config_middle_emulation_get_default_enabled (struct libinput_device *device)
 Check if configurable middle button emulation is enabled by default on this device. More...
 
uint32_t libinput_device_config_scroll_get_methods (struct libinput_device *device)
 Check which scroll methods a device supports. More...
 
enum libinput_config_status libinput_device_config_scroll_set_method (struct libinput_device *device, enum libinput_config_scroll_method method)
 Set the scroll method for this device. More...
 
enum libinput_config_scroll_method libinput_device_config_scroll_get_method (struct libinput_device *device)
 Get the scroll method for this device. More...
 
enum libinput_config_scroll_method libinput_device_config_scroll_get_default_method (struct libinput_device *device)
 Get the default scroll method for this device. More...
 
enum libinput_config_status libinput_device_config_scroll_set_button (struct libinput_device *device, uint32_t button)
 Set the button for the LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN method for this device. More...
 
uint32_t libinput_device_config_scroll_get_button (struct libinput_device *device)
 Get the button for the LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN method for this device. More...
 
uint32_t libinput_device_config_scroll_get_default_button (struct libinput_device *device)
 Get the default button for the LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN method for this device. More...
 
int libinput_device_config_dwt_is_available (struct libinput_device *device)
 Check if this device supports configurable disable-while-typing feature. More...
 
enum libinput_config_status libinput_device_config_dwt_set_enabled (struct libinput_device *device, enum libinput_config_dwt_state enable)
 Enable or disable the disable-while-typing feature. More...
 
enum libinput_config_dwt_state libinput_device_config_dwt_get_enabled (struct libinput_device *device)
 Check if the disable-while typing feature is currently enabled on this device. More...
 
enum libinput_config_dwt_state libinput_device_config_dwt_get_default_enabled (struct libinput_device *device)
 Check if the disable-while typing feature is enabled on this device by default. More...
 
int libinput_device_config_rotation_is_available (struct libinput_device *device)
 Check whether a device can have a custom rotation applied. More...
 
enum libinput_config_status libinput_device_config_rotation_set_angle (struct libinput_device *device, unsigned int degrees_cw)
 Set the rotation of a device in degrees clockwise off the logical neutral position. More...
 
unsigned int libinput_device_config_rotation_get_angle (struct libinput_device *device)
 Get the current rotation of a device in degrees clockwise off the logical neutral position. More...
 
unsigned int libinput_device_config_rotation_get_default_angle (struct libinput_device *device)
 Get the default rotation of a device in degrees clockwise off the logical neutral position. More...
 

Macro Definition Documentation

◆ LIBINPUT_ATTRIBUTE_DEPRECATED

#define LIBINPUT_ATTRIBUTE_DEPRECATED

◆ LIBINPUT_ATTRIBUTE_PRINTF

#define LIBINPUT_ATTRIBUTE_PRINTF (   _format,
  _args 
)