libinput  0.7.0
A wrapper library for input devices
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
libinput.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2013 Jonas Ådahl
3  *
4  * Permission to use, copy, modify, distribute, and sell this software and
5  * its documentation for any purpose is hereby granted without fee, provided
6  * that the above copyright notice appear in all copies and that both that
7  * copyright notice and this permission notice appear in supporting
8  * documentation, and that the name of the copyright holders not be used in
9  * advertising or publicity pertaining to distribution of the software
10  * without specific, written prior permission. The copyright holders make
11  * no representations about the suitability of this software for any
12  * purpose. It is provided "as is" without express or implied warranty.
13  *
14  * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
15  * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
16  * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
17  * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
18  * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
19  * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
20  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
21  */
22 
23 #ifndef LIBINPUT_H
24 #define LIBINPUT_H
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 #include <stdlib.h>
31 #include <stdint.h>
32 #include <libudev.h>
33 
34 #define LIBINPUT_ATTRIBUTE_PRINTF(_format, _args) \
35  __attribute__ ((format (printf, _format, _args)))
36 #define LIBINPUT_ATTRIBUTE_DEPRECATED __attribute__ ((deprecated))
37 
200 };
201 
213 };
214 
224 };
225 
235 };
236 
246 };
247 
248 
263 };
264 
277 
287 
293 
295 
300 
310 };
311 
312 struct libinput;
313 struct libinput_device;
314 struct libinput_seat;
315 
316 struct libinput_event;
317 struct libinput_event_device_notify;
318 struct libinput_event_keyboard;
319 struct libinput_event_pointer;
320 
331 struct libinput_event_touch;
332 
344 void
345 libinput_event_destroy(struct libinput_event *event);
346 
355 libinput_event_get_type(struct libinput_event *event);
356 
365 struct libinput *
366 libinput_event_get_context(struct libinput_event *event);
367 
381 struct libinput_device *
382 libinput_event_get_device(struct libinput_event *event);
383 
394 struct libinput_event_pointer *
395 libinput_event_get_pointer_event(struct libinput_event *event);
396 
407 struct libinput_event_keyboard *
408 libinput_event_get_keyboard_event(struct libinput_event *event);
409 
420 struct libinput_event_touch *
421 libinput_event_get_touch_event(struct libinput_event *event);
422 
434 struct libinput_event_device_notify *
435 libinput_event_get_device_notify_event(struct libinput_event *event);
436 
442 struct libinput_event *
443 libinput_event_device_notify_get_base_event(struct libinput_event_device_notify *event);
444 
457 uint32_t
458 libinput_event_keyboard_get_time(struct libinput_event_keyboard *event);
459 
465 uint32_t
466 libinput_event_keyboard_get_key(struct libinput_event_keyboard *event);
467 
474 libinput_event_keyboard_get_key_state(struct libinput_event_keyboard *event);
475 
476 
482 struct libinput_event *
483 libinput_event_keyboard_get_base_event(struct libinput_event_keyboard *event);
484 
497 uint32_t
499  struct libinput_event_keyboard *event);
500 
513 uint32_t
514 libinput_event_pointer_get_time(struct libinput_event_pointer *event);
515 
534 double
535 libinput_event_pointer_get_dx(struct libinput_event_pointer *event);
536 
555 double
556 libinput_event_pointer_get_dy(struct libinput_event_pointer *event);
557 
575 double
577  struct libinput_event_pointer *event);
578 
596 double
598  struct libinput_event_pointer *event);
599 
615 double
616 libinput_event_pointer_get_absolute_x(struct libinput_event_pointer *event);
617 
633 double
634 libinput_event_pointer_get_absolute_y(struct libinput_event_pointer *event);
635 
653 double
655  struct libinput_event_pointer *event,
656  uint32_t width);
657 
675 double
677  struct libinput_event_pointer *event,
678  uint32_t height);
679 
692 uint32_t
693 libinput_event_pointer_get_button(struct libinput_event_pointer *event);
694 
708 libinput_event_pointer_get_button_state(struct libinput_event_pointer *event);
709 
723 uint32_t
725  struct libinput_event_pointer *event);
726 
740 libinput_event_pointer_get_axis(struct libinput_event_pointer *event);
741 
762 double
763 libinput_event_pointer_get_axis_value(struct libinput_event_pointer *event);
764 
770 struct libinput_event *
771 libinput_event_pointer_get_base_event(struct libinput_event_pointer *event);
772 
773 
785 uint32_t
787 
802 int32_t
804 
819 int32_t
821 
835 double
837 
853 double
855 
869 double
871  uint32_t width);
872 
886 double
888  uint32_t height);
889 
895 struct libinput_event *
897 
914  int (*open_restricted)(const char *path, int flags, void *user_data);
922  void (*close_restricted)(int fd, void *user_data);
923 };
924 
938 struct libinput *
939 libinput_udev_create_context(const struct libinput_interface *interface,
940  void *user_data,
941  struct udev *udev);
942 
964 int
965 libinput_udev_assign_seat(struct libinput *libinput,
966  const char *seat_id);
967 
987 struct libinput *
988 libinput_path_create_context(const struct libinput_interface *interface,
989  void *user_data);
990 
1011 struct libinput_device *
1012 libinput_path_add_device(struct libinput *libinput,
1013  const char *path);
1014 
1033 void
1034 libinput_path_remove_device(struct libinput_device *device);
1035 
1044 int
1045 libinput_get_fd(struct libinput *libinput);
1046 
1060 int
1061 libinput_dispatch(struct libinput *libinput);
1062 
1074 struct libinput_event *
1075 libinput_get_event(struct libinput *libinput);
1076 
1089 libinput_next_event_type(struct libinput *libinput);
1090 
1098 void *
1099 libinput_get_user_data(struct libinput *libinput);
1100 
1112 int
1113 libinput_resume(struct libinput *libinput);
1114 
1124 void
1125 libinput_suspend(struct libinput *libinput);
1126 
1136 struct libinput *
1137 libinput_ref(struct libinput *libinput);
1138 
1149 struct libinput *
1150 libinput_unref(struct libinput *libinput);
1151 
1166 void
1167 libinput_log_set_priority(struct libinput *libinput,
1168  enum libinput_log_priority priority);
1169 
1185 libinput_log_get_priority(const struct libinput *libinput);
1186 
1201 typedef void (*libinput_log_handler)(struct libinput *libinput,
1202  enum libinput_log_priority priority,
1203  const char *format, va_list args)
1205 
1221 void
1222 libinput_log_set_handler(struct libinput *libinput,
1223  libinput_log_handler log_handler);
1224 
1262 struct libinput_seat *
1263 libinput_seat_ref(struct libinput_seat *seat);
1264 
1276 struct libinput_seat *
1277 libinput_seat_unref(struct libinput_seat *seat);
1278 
1290 void
1291 libinput_seat_set_user_data(struct libinput_seat *seat, void *user_data);
1292 
1302 void *
1303 libinput_seat_get_user_data(struct libinput_seat *seat);
1304 
1313 struct libinput *
1314 libinput_seat_get_context(struct libinput_seat *seat);
1315 
1332 const char *
1333 libinput_seat_get_physical_name(struct libinput_seat *seat);
1334 
1344 const char *
1345 libinput_seat_get_logical_name(struct libinput_seat *seat);
1346 
1362 struct libinput_device *
1363 libinput_device_ref(struct libinput_device *device);
1364 
1376 struct libinput_device *
1377 libinput_device_unref(struct libinput_device *device);
1378 
1390 void
1391 libinput_device_set_user_data(struct libinput_device *device, void *user_data);
1392 
1402 void *
1403 libinput_device_get_user_data(struct libinput_device *device);
1404 
1413 struct libinput *
1414 libinput_device_get_context(struct libinput_device *device);
1415 
1427 const char *
1428 libinput_device_get_sysname(struct libinput_device *device);
1429 
1443 const char *
1444 libinput_device_get_name(struct libinput_device *device);
1445 
1454 unsigned int
1455 libinput_device_get_id_product(struct libinput_device *device);
1456 
1465 unsigned int
1466 libinput_device_get_id_vendor(struct libinput_device *device);
1467 
1479 const char *
1480 libinput_device_get_output_name(struct libinput_device *device);
1481 
1495 struct libinput_seat *
1496 libinput_device_get_seat(struct libinput_device *device);
1497 
1520 int
1521 libinput_device_set_seat_logical_name(struct libinput_device *device,
1522  const char *name);
1523 
1539 struct udev_device *
1540 libinput_device_get_udev_device(struct libinput_device *device);
1541 
1552 void
1553 libinput_device_led_update(struct libinput_device *device,
1554  enum libinput_led leds);
1555 
1568 int
1569 libinput_device_get_keys(struct libinput_device *device,
1570  char *keys, size_t size)
1572 
1578 void
1579 libinput_device_calibrate(struct libinput_device *device,
1580  float calibration[6])
1582 
1590 int
1591 libinput_device_has_capability(struct libinput_device *device,
1592  enum libinput_device_capability capability);
1593 
1608 int
1609 libinput_device_get_size(struct libinput_device *device,
1610  double *width,
1611  double *height);
1612 
1625 int
1626 libinput_device_has_button(struct libinput_device *device, uint32_t code);
1627 
1652 };
1653 
1663 const char *
1665 
1674 };
1675 
1690 int
1691 libinput_device_config_tap_get_finger_count(struct libinput_device *device);
1692 
1714 libinput_device_config_tap_set_enabled(struct libinput_device *device,
1715  enum libinput_config_tap_state enable);
1716 
1733 libinput_device_config_tap_get_enabled(struct libinput_device *device);
1734 
1749 libinput_device_config_tap_get_default_enabled(struct libinput_device *device);
1750 
1763 int
1764 libinput_device_config_calibration_has_matrix(struct libinput_device *device);
1765 
1816 libinput_device_config_calibration_set_matrix(struct libinput_device *device,
1817  const float matrix[6]);
1818 
1835 int
1836 libinput_device_config_calibration_get_matrix(struct libinput_device *device,
1837  float matrix[6]);
1838 
1872 int
1873 libinput_device_config_calibration_get_default_matrix(struct libinput_device *device,
1874  float matrix[6]);
1875 
1907 };
1908 
1923 uint32_t
1924 libinput_device_config_send_events_get_modes(struct libinput_device *device);
1925 
1955 libinput_device_config_send_events_set_mode(struct libinput_device *device,
1956  uint32_t mode);
1957 
1977 uint32_t
1978 libinput_device_config_send_events_get_mode(struct libinput_device *device);
1979 
1993 uint32_t
1994 libinput_device_config_send_events_get_default_mode(struct libinput_device *device);
1995 
2005 int
2006 libinput_device_config_accel_is_available(struct libinput_device *device);
2007 
2025 libinput_device_config_accel_set_speed(struct libinput_device *device,
2026  double speed);
2027 
2039 double
2040 libinput_device_config_accel_get_speed(struct libinput_device *device);
2041 
2052 double
2053 libinput_device_config_accel_get_default_speed(struct libinput_device *device);
2054 
2084 int
2085 libinput_device_config_scroll_has_natural_scroll(struct libinput_device *device);
2086 
2102 libinput_device_config_scroll_set_natural_scroll_enabled(struct libinput_device *device,
2103  int enable);
2117 int
2118 libinput_device_config_scroll_get_natural_scroll_enabled(struct libinput_device *device);
2119 
2133 int
2135 
2150 int
2151 libinput_device_config_buttons_has_left_handed(struct libinput_device *device);
2152 
2179 libinput_device_config_buttons_set_left_handed(struct libinput_device *device,
2180  int left_handed);
2181 
2195 int
2196 libinput_device_config_buttons_get_left_handed(struct libinput_device *device);
2197 
2211 int
2212 libinput_device_config_buttons_get_default_left_handed(struct libinput_device *device);
2213 
2240 };
2241 
2259 uint32_t
2260 libinput_device_config_scroll_get_methods(struct libinput_device *device);
2261 
2287 libinput_device_config_scroll_set_method(struct libinput_device *device,
2288  enum libinput_config_scroll_method method);
2289 
2307 libinput_device_config_scroll_get_method(struct libinput_device *device);
2308 
2326 libinput_device_config_scroll_get_default_method(struct libinput_device *device);
2327 
2363 libinput_device_config_scroll_set_button(struct libinput_device *device,
2364  uint32_t button);
2365 
2390 uint32_t
2391 libinput_device_config_scroll_get_button(struct libinput_device *device);
2392 
2412 uint32_t
2413 libinput_device_config_scroll_get_default_button(struct libinput_device *device);
2414 
2415 #ifdef __cplusplus
2416 }
2417 #endif
2418 #endif /* LIBINPUT_H */
const char * libinput_seat_get_physical_name(struct libinput_seat *seat)
Return the physical name of the seat.
libinput_log_priority
Log priority for internal logging messages.
Definition: libinput.h:196
Never send scroll events instead of pointer motion events.
Definition: libinput.h:2225
void libinput_device_calibrate(struct libinput_device *device, float calibration[6]) 1
void(*) voi libinput_log_set_handler)(struct libinput *libinput, libinput_log_handler log_handler)
Set the global log handler.
Definition: libinput.h:1222
unsigned int libinput_device_get_id_product(struct libinput_device *device)
Get the product ID for this device.
Definition: libinput.h:212
uint32_t libinput_event_pointer_get_button(struct libinput_event_pointer *event)
Return the button that triggered this event.
void(* close_restricted)(int fd, void *user_data)
Close the file descriptor.
Definition: libinput.h:922
Definition: libinput.h:303
int libinput_dispatch(struct libinput *libinput)
Main event dispatchment function.
struct libinput * libinput_ref(struct libinput *libinput)
Add a reference to the context.
Definition: libinput.h:902
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.
Definition: libinput.h:299
Definition: libinput.h:245
libinput_led
Mask reflecting LEDs on a device.
Definition: libinput.h:231
Touch event representing a touch down, move or up, as well as a touch cancel and touch frame events...
Definition: libinput.h:319
Definition: libinput.h:301
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:262
Signals the end of a set of touchpoints at one device sample time.
Definition: libinput.h:309
Config applied successfully.
Definition: libinput.h:1648
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:234
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...
void * libinput_seat_get_user_data(struct libinput_seat *seat)
Get the caller-specific data associated with this seat, if any.
Tapping is to be enabled, or is currently enabled.
Definition: libinput.h:1672
struct libinput_event * libinput_event_device_notify_get_base_event(struct libinput_event_device_notify *event)
Definition: libinput.h:294
uint32_t libinput_device_config_scroll_get_default_button(struct libinput_device *device)
Get the default button for LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN method for this device.
Signals that a device has been added to the context.
Definition: libinput.h:286
Send events from this device normally.
Definition: libinput.h:1886
Configuration not available on this device.
Definition: libinput.h:1649
Definition: libinput.h:296
double libinput_event_pointer_get_dy(struct libinput_event_pointer *event)
Return the delta between the last event and the current 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:292
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 global log priority.
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.
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:243
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 2 fingers are down on the device.
Definition: libinput.h:2229
uint32_t libinput_event_touch_get_time(struct libinput_event_touch *event)
int libinput_device_has_button(struct libinput_device *device, uint32_t code)
Check if a LIBINPUT_DEVICE_CAP_POINTER device has a button with the passed in code (see linux/input...
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...
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:298
Definition: libinput.h:198
enum libinput_key_state libinput_event_keyboard_get_key_state(struct libinput_event_keyboard *event)
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 that are not x or y coordinates.
Definition: libinput.h:260
int libinput_device_config_calibration_has_matrix(struct libinput_device *device)
Check if the device can be calibrated via a calibration matrix.
libinput_config_tap_state
Definition: libinput.h:1669
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:914
Definition: libinput.h:210
#define LIBINPUT_ATTRIBUTE_DEPRECATED
Definition: libinput.h:36
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:1201
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_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:222
libinput_device_capability
Capabilities on a device.
Definition: libinput.h:209
Definition: libinput.h:302
libinput_config_status
Status codes returned when applying configuration settings.
Definition: libinput.h:1647
Definition: libinput.h:223
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...
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.
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.
void libinput_device_led_update(struct libinput_device *device, enum libinput_led leds)
Update the LEDs on the device, if any.
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...
Definition: libinput.h:197
struct libinput * libinput_event_get_context(struct libinput_event *event)
Get the libinput context from the event.
Definition: libinput.h:304
#define LIBINPUT_ATTRIBUTE_PRINTF(_format, _args)
Definition: libinput.h:34
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.
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...
If an external pointer device is plugged in, do not send events from this device. ...
Definition: libinput.h:1906
struct libinput_seat * libinput_seat_unref(struct libinput_seat *seat)
Decrease the refcount of the seat.
int libinput_device_config_tap_get_finger_count(struct libinput_device *device)
Check if the device supports tap-to-click.
struct libinput * libinput_device_get_context(struct libinput_device *device)
Get the libinput context from the device.
Invalid parameter range.
Definition: libinput.h:1651
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.
double libinput_event_pointer_get_axis_value(struct libinput_event_pointer *event)
Return the axis value of the given axis.
struct libinput_device * libinput_event_get_device(struct libinput_event *event)
Return the device associated with this event, if applicable.
void * libinput_get_user_data(struct libinput *libinput)
int libinput_device_config_buttons_has_left_handed(struct libinput_device *device)
Check if a device has a button configuration that supports left-handed usage.
Definition: libinput.h:211
enum libinput_config_status libinput_device_config_buttons_set_left_handed(struct libinput_device *device, int left_handed)
Set the left-handed configuration of the device.
void libinput_event_destroy(struct libinput_event *event)
Destroy the event.
Definition: libinput.h:297
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:232
int libinput_device_config_buttons_get_default_left_handed(struct libinput_device *device)
Get the default left-handed configuration of the device.
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:2239
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:2220
Send scroll events when a finger is moved along the bottom or right edge of a device.
Definition: libinput.h:2234
Tapping is to be disabled, or is currently disabled.
Definition: libinput.h:1670
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:1880
Definition: libinput.h:244
int libinput_get_fd(struct libinput *libinput)
libinput keeps a single file descriptor for all events.
int libinput_resume(struct libinput *libinput)
Resume a suspended libinput context.
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:270
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.
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)
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:233
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.
struct libinput_seat * libinput_device_get_seat(struct libinput_device *device)
Get the seat associated with this input device.
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:261
Do not send events through this device.
Definition: libinput.h:1900
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.
struct libinput * libinput_unref(struct libinput *libinput)
Dereference the libinput context.
int libinput_device_config_buttons_get_left_handed(struct libinput_device *device)
Get the current left-handed configuration of the device.
enum libinput_log_priority libinput_log_get_priority(const struct libinput *libinput)
Get the global 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.
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.
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...
enum libinput_pointer_axis libinput_event_pointer_get_axis(struct libinput_event_pointer *event)
Return the axis that triggered this event.
enum libinput_config_tap_state libinput_device_config_tap_get_default_enabled(struct libinput_device *device)
Return the default setting for whether tapping is enabled on this device.
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:221
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:276
void libinput_device_set_user_data(struct libinput_device *device, void *user_data)
Set caller-specific data associated with this input device.
int libinput_device_get_keys(struct libinput_device *device, char *keys, size_t size) 1
Set the bitmask in keys to the bitmask of the keys present on the device (see linux/input.h), up to size characters.
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.
uint32_t libinput_device_config_send_events_get_modes(struct libinput_device *device)
Return the possible send-event modes for this device.
Definition: libinput.h:199
struct libinput_event_touch * libinput_event_get_touch_event(struct libinput_event *event)
Return the touch event that is this input event.