libinput.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2013 Jonas Ådahl
3  * Copyright © 2013-2015 Red Hat, Inc.
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a
6  * copy of this software and associated documentation files (the "Software"),
7  * to deal in the Software without restriction, including without limitation
8  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9  * and/or sell copies of the Software, and to permit persons to whom the
10  * Software is furnished to do so, subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice (including the next
13  * paragraph) shall be included in all copies or substantial portions of the
14  * Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  * DEALINGS IN THE SOFTWARE.
23  */
24 
25 #ifndef LIBINPUT_H
26 #define LIBINPUT_H
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 #include <stdlib.h>
33 #include <stdint.h>
34 #include <libudev.h>
35 
36 #define LIBINPUT_ATTRIBUTE_PRINTF(_format, _args) \
37  __attribute__ ((format (printf, _format, _args)))
38 #define LIBINPUT_ATTRIBUTE_DEPRECATED __attribute__ ((deprecated))
39 
49 };
50 
62 };
63 
73 };
74 
84 };
85 
95 };
96 
112 };
113 
134 };
135 
148 
158 
164 
166 
171 
181 
188 };
189 
197 struct libinput;
198 
207 
217 
226 
238 
246 
254 
263 
274 struct libinput_event_touch;
275 
292 void
294 
304 
313 struct libinput *
315 
329 struct libinput_device *
331 
342 struct libinput_event_pointer *
344 
357 
368 struct libinput_event_touch *
370 
381 struct libinput_event_gesture *
383 
397 
403 struct libinput_event *
405 
418 uint32_t
420 
426 uint64_t
428 
434 uint32_t
436 
444 
450 struct libinput_event *
452 
465 uint32_t
467  struct libinput_event_keyboard *event);
468 
481 uint32_t
483 
489 uint64_t
491 
510 double
512 
531 double
533 
552 double
554  struct libinput_event_pointer *event);
555 
574 double
576  struct libinput_event_pointer *event);
577 
593 double
595 
611 double
613 
631 double
633  struct libinput_event_pointer *event,
634  uint32_t width);
635 
653 double
655  struct libinput_event_pointer *event,
656  uint32_t height);
657 
670 uint32_t
672 
687 
701 uint32_t
703  struct libinput_event_pointer *event);
704 
722 int
724  enum libinput_pointer_axis axis);
725 
750 double
752  enum libinput_pointer_axis axis);
753 
791 
808 double
810  enum libinput_pointer_axis axis);
811 
817 struct libinput_event *
819 
831 uint32_t
833 
839 uint64_t
841 
861 int32_t
863 
883 int32_t
885 
903 double
905 
923 double
925 
943 double
945  uint32_t width);
946 
964 double
966  uint32_t height);
967 
973 struct libinput_event *
975 
995 uint32_t
996 libinput_event_gesture_get_time(struct libinput_event_gesture *event);
997 
1003 uint64_t
1004 libinput_event_gesture_get_time_usec(struct libinput_event_gesture *event);
1005 
1011 struct libinput_event *
1012 libinput_event_gesture_get_base_event(struct libinput_event_gesture *event);
1013 
1025 int
1026 libinput_event_gesture_get_finger_count(struct libinput_event_gesture *event);
1027 
1042 int
1043 libinput_event_gesture_get_cancelled(struct libinput_event_gesture *event);
1044 
1060 double
1061 libinput_event_gesture_get_dx(struct libinput_event_gesture *event);
1062 
1078 double
1079 libinput_event_gesture_get_dy(struct libinput_event_gesture *event);
1080 
1096 double
1098  struct libinput_event_gesture *event);
1099 
1115 double
1117  struct libinput_event_gesture *event);
1118 
1145 double
1146 libinput_event_gesture_get_scale(struct libinput_event_gesture *event);
1147 
1169 double
1170 libinput_event_gesture_get_angle_delta(struct libinput_event_gesture *event);
1171 
1199  int (*open_restricted)(const char *path, int flags, void *user_data);
1207  void (*close_restricted)(int fd, void *user_data);
1208 };
1209 
1223 struct libinput *
1224 libinput_udev_create_context(const struct libinput_interface *interface,
1225  void *user_data,
1226  struct udev *udev);
1227 
1249 int
1251  const char *seat_id);
1252 
1272 struct libinput *
1273 libinput_path_create_context(const struct libinput_interface *interface,
1274  void *user_data);
1275 
1296 struct libinput_device *
1298  const char *path);
1299 
1318 void
1320 
1329 int
1331 
1349 int
1351 
1363 struct libinput_event *
1365 
1379 
1391 void
1393  void *user_data);
1394 
1404 void *
1406 
1418 int
1420 
1430 void
1432 
1442 struct libinput *
1443 libinput_ref(struct libinput *libinput);
1444 
1475 struct libinput *
1477 
1493 void
1495  enum libinput_log_priority priority);
1496 
1513 
1528 typedef void (*libinput_log_handler)(struct libinput *libinput,
1529  enum libinput_log_priority priority,
1530  const char *format, va_list args)
1532 
1548 void
1549 libinput_log_set_handler(struct libinput *libinput,
1550  libinput_log_handler log_handler);
1551 
1572 struct libinput_seat *
1573 libinput_seat_ref(struct libinput_seat *seat);
1574 
1586 struct libinput_seat *
1587 libinput_seat_unref(struct libinput_seat *seat);
1588 
1600 void
1601 libinput_seat_set_user_data(struct libinput_seat *seat, void *user_data);
1602 
1612 void *
1614 
1623 struct libinput *
1625 
1642 const char *
1644 
1654 const char *
1656 
1672 struct libinput_device *
1673 libinput_device_ref(struct libinput_device *device);
1674 
1686 struct libinput_device *
1687 libinput_device_unref(struct libinput_device *device);
1688 
1700 void
1701 libinput_device_set_user_data(struct libinput_device *device, void *user_data);
1702 
1712 void *
1714 
1723 struct libinput *
1725 
1786 struct libinput_device_group *
1788 
1800 const char *
1802 
1816 const char *
1818 
1827 unsigned int
1829 
1838 unsigned int
1840 
1852 const char *
1854 
1869 struct libinput_seat *
1871 
1897 int
1899  const char *name);
1900 
1920 struct udev_device *
1922 
1933 void
1935  enum libinput_led leds);
1936 
1944 int
1946  enum libinput_device_capability capability);
1947 
1962 int
1964  double *width,
1965  double *height);
1966 
1979 int
1980 libinput_device_pointer_has_button(struct libinput_device *device, uint32_t code);
1981 
1994 int
1996  uint32_t code);
1997 
2010 struct libinput_device_group *
2012 
2026 struct libinput_device_group *
2028 
2040 void
2042  void *user_data);
2043 
2054 void *
2056 
2081 };
2082 
2092 const char *
2094 
2103 };
2104 
2120 int
2122 
2145  enum libinput_config_tap_state enable);
2146 
2165 
2182 
2191 };
2192 
2217  enum libinput_config_drag_lock_state enable);
2218 
2238 
2261 
2274 int
2276 
2328  const float matrix[6]);
2329 
2346 int
2348  float matrix[6]);
2349 
2369 int
2371  float matrix[6]);
2372 
2406 };
2407 
2422 uint32_t
2424 
2455  uint32_t mode);
2456 
2476 uint32_t
2478 
2492 uint32_t
2494 
2504 int
2506 
2525  double speed);
2526 
2538 double
2540 
2551 double
2553 
2568 
2574 };
2575 
2586 uint32_t
2588 
2602  enum libinput_config_accel_profile mode);
2603 
2615 
2627 
2657 int
2659 
2676  int enable);
2690 int
2692 
2706 int
2708 
2722 int
2724 
2750  int left_handed);
2751 
2765 int
2767 
2781 int
2783 
2806 };
2807 
2823 uint32_t
2825 
2848  enum libinput_config_click_method method);
2866 
2884 
2899 };
2900 
2921 int
2923  struct libinput_device *device);
2924 
2957  struct libinput_device *device,
2959 
2982  struct libinput_device *device);
2983 
3007  struct libinput_device *device);
3008 
3036 };
3037 
3055 uint32_t
3057 
3084  enum libinput_config_scroll_method method);
3085 
3104 
3123 
3161  uint32_t button);
3162 
3187 uint32_t
3189 
3210 uint32_t
3212 
3222 };
3223 
3239 int
3241 
3265  enum libinput_config_dwt_state enable);
3266 
3284 
3302 
3303 #ifdef __cplusplus
3304 }
3305 #endif
3306 #endif /* LIBINPUT_H */
Definition: libinput.h:185
libinput_config_dwt_state
Possible states for the disable-while-typing feature.
Definition: libinput.h:3219
const char * libinput_seat_get_physical_name(struct libinput_seat *seat)
Return the physical name of the seat.
Middle mouse button emulation is to be disabled, or is currently disabled.
Definition: libinput.h:2893
A base handle for accessing libinput devices.
Definition: libinput.h:197
Never send scroll events instead of pointer motion events.
Definition: libinput.h:3020
Placeholder for devices that don't have a configurable pointer acceleration profile.
Definition: libinput.h:2559
uint32_t libinput_device_config_accel_get_profiles(struct libinput_device *device)
Returns a bitmask of the configurable acceleration modes available on this device.
unsigned int libinput_device_get_id_product(struct libinput_device *device)
Get the product ID for this device.
Definition: libinput.h:60
uint32_t libinput_event_pointer_get_button(struct libinput_event_pointer *event)
Return the button that triggered this event.
Definition: libinput.h:174
int libinput_dispatch(struct libinput *libinput)
Main event dispatchment function.
struct libinput * libinput_ref(struct libinput *libinput)
Add a reference to the context.
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_UPDAT...
libinput does not open file descriptors to devices directly, instead open_restricted() and close_rest...
Definition: libinput.h:1187
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.
Definition: libinput.h:46
The number of fingers decides which button press to generate.
Definition: libinput.h:2805
libinput_config_accel_profile
Definition: libinput.h:2554
Definition: libinput.h:170
Definition: libinput.h:94
libinput_led
Mask reflecting LEDs on a device.
Definition: libinput.h:80
libinput_pointer_axis_source
The source for a libinput_pointer_axis event.
Definition: libinput.h:120
Touch event representing a touch down, move or up, as well as a touch cancel and touch frame events...
Definition: libinput.h:262
struct libinput_event * libinput_event_gesture_get_base_event(struct libinput_event_gesture *event)
Definition: libinput.h:172
int32_t libinput_event_touch_get_slot(struct libinput_event_touch *event)
Get the slot of this touch event.
void * libinput_device_get_user_data(struct libinput_device *device)
Get the caller-specific data associated with this input device, if any.
struct libinput_seat * libinput_seat_ref(struct libinput_seat *seat)
Increase the refcount of the seat.
Definition: libinput.h:111
Signals the end of a set of touchpoints at one device sample time.
Definition: libinput.h:180
uint64_t libinput_event_keyboard_get_time_usec(struct libinput_event_keyboard *event)
Config applied successfully.
Definition: libinput.h:2077
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.
const char * libinput_device_get_name(struct libinput_device *device)
The descriptive device name as advertised by the kernel and/or the hardware itself.
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.
Definition: libinput.h:83
Use software-button areas (see Clickfinger behavior) to generate button events.
Definition: libinput.h:2801
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 de...
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 betwe...
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.
void * libinput_seat_get_user_data(struct libinput_seat *seat)
Get the caller-specific data associated with this seat, if any.
The event is caused by the movement of one or more fingers on a device.
Definition: libinput.h:129
Tapping is to be enabled, or is currently enabled.
Definition: libinput.h:2101
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.
int libinput_event_gesture_get_finger_count(struct libinput_event_gesture *event)
Return the number of fingers used for a gesture.
struct libinput_event * libinput_event_device_notify_get_base_event(struct libinput_event_device_notify *event)
enum libinput_config_middle_emulation_state libinput_device_config_middle_emulation_get_enabled(struct libinput_device *device)
Check if configurable middle button emulation is enabled on this device.
enum libinput_config_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.
Do not send software-emulated button events.
Definition: libinput.h:2796
Definition: libinput.h:165
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...
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.
Definition: libinput.h:1528
Definition: libinput.h:186
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.
Signals that a device has been added to the context.
Definition: libinput.h:157
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.
Configuration not available on this device.
Definition: libinput.h:2078
void(* close_restricted)(int fd, void *user_data)
Close the file descriptor.
Definition: libinput.h:1207
Definition: libinput.h:167
double libinput_event_pointer_get_dy(struct libinput_event_pointer *event)
Return the delta between the last event and the current event.
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.
uint32_t libinput_event_gesture_get_time(struct libinput_event_gesture *event)
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 s...
Signals that a device has been removed.
Definition: libinput.h:163
int libinput_device_config_calibration_get_default_matrix(struct libinput_device *device, float matrix[6])
Return the default calibration matrix for this device.
void libinput_log_set_priority(struct libinput *libinput, enum libinput_log_priority priority)
Set the log priority for the libinput context.
int libinput_device_config_scroll_get_natural_scroll_enabled(struct libinput_device *device)
Get the current mode for scrolling 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.
Definition: libinput.h:187
Definition: libinput.h:47
libinput_config_send_events_mode
The send-event mode of a device defines when a device may generate events and pass those events to th...
Definition: libinput.h:2379
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 s...
libinput_button_state
Logical state of a physical button.
Definition: libinput.h:92
const char * libinput_config_status_to_str(enum libinput_config_status status)
Return a string describing the error.
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.
struct libinput_device * libinput_device_ref(struct libinput_device *device)
Increase the refcount of the input device.
Send scroll events when two fingers are logically down on the device.
Definition: libinput.h:3025
uint32_t libinput_event_touch_get_time(struct libinput_event_touch *event)
A pointer event representing relative or absolute pointer movement, a button press/release or scroll ...
Definition: libinput.h:253
double libinput_device_config_accel_get_speed(struct libinput_device *device)
Get the current pointer acceleration setting for this pointer device.
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 de...
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 o...
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.
int libinput_device_config_calibration_get_matrix(struct libinput_device *device, float matrix[6])
Return the current calibration matrix for this device.
enum libinput_config_status libinput_device_config_scroll_set_button(struct libinput_device *device, uint32_t button)
Set the button for the LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN method for this device.
Definition: libinput.h:169
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.
enum libinput_key_state libinput_event_keyboard_get_key_state(struct libinput_event_keyboard *event)
int libinput_device_config_left_handed_is_available(struct libinput_device *device)
Check if a device has a configuration that supports left-handed usage.
double libinput_event_pointer_get_dx(struct libinput_event_pointer *event)
Return the delta between the last event and the current event.
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...
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 ...
struct libinput_event_device_notify * libinput_event_get_device_notify_event(struct libinput_event *event)
Return the device event that is this input event.
libinput_pointer_axis
Axes on a device with the capability LIBINPUT_DEVICE_CAP_POINTER that are not x or y coordinates...
Definition: libinput.h:109
void libinput_device_group_set_user_data(struct libinput_device_group *group, void *user_data)
Set caller-specific data associated with this device group.
int libinput_device_config_calibration_has_matrix(struct libinput_device *device)
Check if the device can be calibrated via a calibration matrix.
int libinput_device_config_dwt_is_available(struct libinput_device *device)
Check if this device supports configurable disable-while-typing feature.
libinput_config_tap_state
Definition: libinput.h:2098
Definition: libinput.h:58
void libinput_set_user_data(struct libinput *libinput, void *user_data)
Set caller-specific data associated with this context.
Middle mouse button emulation is to be enabled, or is currently enabled.
Definition: libinput.h:2898
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.
uint32_t libinput_device_config_send_events_get_default_mode(struct libinput_device *device)
Get the default send-event mode for this device.
enum libinput_pointer_axis_source libinput_event_pointer_get_axis_source(struct libinput_event_pointer *event)
Return the source for a given axis event.
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.
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 t...
Definition: libinput.h:71
libinput_device_capability
Capabilities on a device.
Definition: libinput.h:57
The event is caused by the rotation of a wheel.
Definition: libinput.h:124
Definition: libinput.h:173
libinput_config_status
Status codes returned when applying configuration settings.
Definition: libinput.h:2076
Definition: libinput.h:72
Definition: libinput.h:183
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 de...
int libinput_device_config_middle_emulation_is_available(struct libinput_device *device)
Check if middle mouse button emulation configuration is available on this device. ...
enum libinput_config_scroll_method libinput_device_config_scroll_get_method(struct libinput_device *device)
Get the scroll method for this device.
int32_t libinput_event_touch_get_seat_slot(struct libinput_event_touch *event)
Get the seat slot of the touch event.
Definition: libinput.h:48
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 ...
uint32_t libinput_device_config_send_events_get_mode(struct libinput_device *device)
Get the send-event mode for this device.
int libinput_event_gesture_get_cancelled(struct libinput_event_gesture *event)
Return if the gesture ended normally, or if it was cancelled.
void libinput_device_led_update(struct libinput_device *device, enum libinput_led leds)
Update the LEDs on the device, if any.
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.
struct libinput_device * libinput_path_add_device(struct libinput *libinput, const char *path)
Add a device to a libinput context initialized with libinput_path_create_context().
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...
double libinput_event_gesture_get_dy(struct libinput_event_gesture *event)
Return the delta between the last event and the current event.
struct libinput * libinput_event_get_context(struct libinput_event *event)
Get the libinput context from the event.
Drag lock is to be enabled, or is currently disabled.
Definition: libinput.h:2190
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.
enum libinput_config_click_method libinput_device_config_click_get_method(struct libinput_device *device)
Get the button click method for this device.
Definition: libinput.h:175
struct libinput_event_gesture * libinput_event_get_gesture_event(struct libinput_event *event)
Return the gesture event that is this input event.
The base event type.
Definition: libinput.h:225
#define LIBINPUT_ATTRIBUTE_PRINTF(_format, _args)
Definition: libinput.h:36
libinput_config_click_method
The click method defines when to generate software-emulated buttons, usually on a device that does no...
Definition: libinput.h:2791
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.
A base handle for accessing libinput device groups.
Definition: libinput.h:206
int libinput_device_config_left_handed_get_default(struct libinput_device *device)
Get the default left-handed configuration of the device.
struct libinput * libinput_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 libinpu...
struct libinput_seat * libinput_seat_unref(struct libinput_seat *seat)
Decrease the refcount of the seat.
Send events from this device normally.
Definition: libinput.h:2385
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.
Definition: libinput.h:3220
struct libinput * libinput_device_get_context(struct libinput_device *device)
Get the libinput context from the device.
Invalid parameter range.
Definition: libinput.h:2080
unsigned int libinput_device_get_id_vendor(struct libinput_device *device)
Get the vendor ID for this device.
enum libinput_event_type libinput_event_get_type(struct libinput_event *event)
Get the type of the event.
struct libinput_device_group * libinput_device_group_ref(struct libinput_device_group *group)
Increase the refcount of the device group.
A handle for accessing libinput.
double libinput_event_gesture_get_dx(struct libinput_event_gesture *event)
Return the delta between the last event and the current event.
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.
struct libinput_device * libinput_event_get_device(struct libinput_event *event)
Return the device associated with this event.
void * libinput_get_user_data(struct libinput *libinput)
Get the caller-specific data associated with this context, if any.
Drag lock is to be disabled, or is currently disabled.
Definition: libinput.h:2188
Definition: libinput.h:59
void libinput_event_destroy(struct libinput_event *event)
Destroy the event, freeing all associated resources.
Definition: libinput.h:168
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.
void libinput_suspend(struct libinput *libinput)
Suspend monitoring for new devices and close existing devices.
enum libinput_config_scroll_method libinput_device_config_scroll_get_default_method(struct libinput_device *device)
Get the default scroll method for this device.
int libinput_device_config_scroll_has_natural_scroll(struct libinput_device *device)
Return non-zero if the device supports "natural scrolling".
Definition: libinput.h:81
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.
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.
uint64_t libinput_event_pointer_get_time_usec(struct libinput_event_pointer *event)
uint64_t libinput_event_gesture_get_time_usec(struct libinput_event_gesture *event)
uint32_t libinput_event_keyboard_get_key(struct libinput_event_keyboard *event)
Send scroll events when a button is down and the device moves along a scroll-capable axis...
Definition: libinput.h:3035
libinput_config_scroll_method
The scroll method of a device selects when to generate scroll axis events instead of pointer motion e...
Definition: libinput.h:3015
Send scroll events when a finger moves along the bottom or right edge of a device.
Definition: libinput.h:3030
Tapping is to be disabled, or is currently disabled.
Definition: libinput.h:2099
Definition: libinput.h:93
int libinput_get_fd(struct libinput *libinput)
libinput keeps a single file descriptor for all events.
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.
int libinput_resume(struct libinput *libinput)
Resume a suspended libinput context.
Definition: libinput.h:184
The base handle for accessing libinput seats.
Definition: libinput.h:216
Definition: libinput.h:61
struct libinput * libinput_udev_create_context(const struct libinput_interface *interface, void *user_data, struct udev *udev)
Create a new libinput context from udev.
libinput_event_type
Event type for events returned by libinput_get_event().
Definition: libinput.h:141
uint32_t libinput_device_config_click_get_methods(struct libinput_device *device)
Check which button click methods a device supports.
struct libinput_event * libinput_get_event(struct libinput *libinput)
Retrieve the next event from libinput's internal event queue.
enum libinput_event_type libinput_next_event_type(struct libinput *libinput)
Return the type of the next event in the internal queue.
int libinput_device_has_capability(struct libinput_device *device, enum libinput_device_capability capability)
Check if the given device has the specified capability.
The event is caused by the motion of some device.
Definition: libinput.h:133
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...
uint32_t libinput_event_keyboard_get_time(struct libinput_event_keyboard *event)
Do not send events through this device.
Definition: libinput.h:2399
struct libinput_event_keyboard * libinput_event_get_keyboard_event(struct libinput_event *event)
Return the keyboard event that is this input event.
Definition: libinput.h:82
int libinput_device_config_accel_is_available(struct libinput_device *device)
Check if a device uses libinput-internal pointer-acceleration.
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.
libinput_config_middle_emulation_state
Definition: libinput.h:2888
struct libinput_seat * libinput_device_get_seat(struct libinput_device *device)
Get the seat associated with this input device, see Seats for details.
enum libinput_button_state libinput_event_pointer_get_button_state(struct libinput_event_pointer *event)
Return the button state that triggered this event.
Definition: libinput.h:110
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.
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.
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.
struct libinput * libinput_unref(struct libinput *libinput)
Dereference the libinput context.
Definition: libinput.h:182
An adaptive acceleration profile.
Definition: libinput.h:2573
void(*) voi libinput_log_set_handler)(struct libinput *libinput, libinput_log_handler log_handler)
Set the context's log handler.
Definition: libinput.h:1549
enum libinput_log_priority libinput_log_get_priority(const struct libinput *libinput)
Get the context's log priority.
const char * libinput_device_get_sysname(struct libinput_device *device)
Get the system name of the device.
struct libinput_device * libinput_device_unref(struct libinput_device *device)
Decrease the refcount of the input device.
libinput_config_drag_lock_state
Definition: libinput.h:2186
int libinput_device_config_scroll_get_default_natural_scroll_enabled(struct libinput_device *device)
Get the default mode for scrolling on this device.
int libinput_device_get_size(struct libinput_device *device, double *width, double *height)
Get the physical size of a device in mm, where meaningful.
void libinput_seat_set_user_data(struct libinput_seat *seat, void *user_data)
Set caller-specific data associated with this seat.
const char * libinput_seat_get_logical_name(struct libinput_seat *seat)
Return the logical name of the seat.
If an external pointer device is plugged in, do not send events from this device. ...
Definition: libinput.h:2405
libinput_log_priority
Log priority for internal logging messages.
Definition: libinput.h:45
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...
int libinput_udev_assign_seat(struct libinput *libinput, const char *seat_id)
Assign a seat to this libinput context.
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...
int(* open_restricted)(const char *path, int flags, void *user_data)
Open the device at the given path with the flags provided and return the fd.
Definition: libinput.h:1199
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.
An event notifying the caller of a device being added or removed.
Definition: libinput.h:237
struct libinput_device_group * libinput_device_group_unref(struct libinput_device_group *group)
Decrease the refcount of the device group.
uint32_t libinput_device_config_scroll_get_methods(struct libinput_device *device)
Check which scroll methods a device supports.
struct libinput_event * libinput_event_keyboard_get_base_event(struct libinput_event_keyboard *event)
const char * libinput_device_get_output_name(struct libinput_device *device)
A device may be mapped to a single output, or all available outputs.
uint32_t libinput_event_pointer_get_time(struct libinput_event_pointer *event)
struct libinput_event * libinput_event_touch_get_base_event(struct libinput_event_touch *event)
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].
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.
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.
libinput_key_state
Logical state of a key.
Definition: libinput.h:70
This is not a real event type, and is only used to tell the user that no new event is available in th...
Definition: libinput.h:147
void libinput_device_set_user_data(struct libinput_device *device, void *user_data)
Set caller-specific data associated with this input device.
uint64_t libinput_event_touch_get_time_usec(struct libinput_event_touch *event)
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...
int libinput_device_config_left_handed_get(struct libinput_device *device)
Get the current left-handed configuration of the device.
A flat acceleration profile.
Definition: libinput.h:2567
A keyboard event representing a key press/release.
Definition: libinput.h:245
struct libinput * libinput_seat_get_context(struct libinput_seat *seat)
Get the libinput context from the seat.
struct libinput_event * libinput_event_pointer_get_base_event(struct libinput_event_pointer *event)
struct libinput_event_pointer * libinput_event_get_pointer_event(struct libinput_event *event)
Return the pointer event that is this input event.
struct libinput_device_group * libinput_device_get_device_group(struct libinput_device *device)
Get the device group this device is assigned to.
uint32_t libinput_device_config_send_events_get_modes(struct libinput_device *device)
Return the possible send-event modes for this device.
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.
Definition: libinput.h:3221
struct libinput_event_touch * libinput_event_get_touch_event(struct libinput_event *event)
Return the touch event that is this input event.