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 
63 };
64 
74 };
75 
85 };
86 
96 };
97 
113 };
114 
135 };
136 
152 struct libinput_tablet_tool;
153 
183 };
184 
202 };
203 
216 };
217 
230 
240 
246 
248 
253 
263 
341 
348 };
349 
357 struct libinput;
358 
367 
377 
386 
398 
406 
414 
423 
435 
447 
464 void
466 
476 
485 struct libinput *
487 
501 struct libinput_device *
503 
514 struct libinput_event_pointer *
516 
529 
540 struct libinput_event_touch *
542 
553 struct libinput_event_gesture *
555 
568 
582 
588 struct libinput_event *
590 
603 uint32_t
605 
611 uint64_t
613 
619 uint32_t
621 
629 
635 struct libinput_event *
637 
650 uint32_t
652  struct libinput_event_keyboard *event);
653 
666 uint32_t
668 
674 uint64_t
676 
695 double
697 
716 double
718 
737 double
739  struct libinput_event_pointer *event);
740 
759 double
761  struct libinput_event_pointer *event);
762 
778 double
780 
796 double
798 
816 double
818  struct libinput_event_pointer *event,
819  uint32_t width);
820 
838 double
840  struct libinput_event_pointer *event,
841  uint32_t height);
842 
855 uint32_t
857 
872 
886 uint32_t
888  struct libinput_event_pointer *event);
889 
907 int
909  enum libinput_pointer_axis axis);
910 
935 double
937  enum libinput_pointer_axis axis);
938 
976 
993 double
995  enum libinput_pointer_axis axis);
996 
1002 struct libinput_event *
1004 
1016 uint32_t
1018 
1024 uint64_t
1026 
1046 int32_t
1048 
1068 int32_t
1070 
1088 double
1090 
1108 double
1110 
1128 double
1130  uint32_t width);
1131 
1149 double
1151  uint32_t height);
1152 
1158 struct libinput_event *
1160 
1180 uint32_t
1181 libinput_event_gesture_get_time(struct libinput_event_gesture *event);
1182 
1188 uint64_t
1189 libinput_event_gesture_get_time_usec(struct libinput_event_gesture *event);
1190 
1196 struct libinput_event *
1197 libinput_event_gesture_get_base_event(struct libinput_event_gesture *event);
1198 
1210 int
1211 libinput_event_gesture_get_finger_count(struct libinput_event_gesture *event);
1212 
1227 int
1228 libinput_event_gesture_get_cancelled(struct libinput_event_gesture *event);
1229 
1245 double
1246 libinput_event_gesture_get_dx(struct libinput_event_gesture *event);
1247 
1263 double
1264 libinput_event_gesture_get_dy(struct libinput_event_gesture *event);
1265 
1281 double
1283  struct libinput_event_gesture *event);
1284 
1300 double
1302  struct libinput_event_gesture *event);
1303 
1330 double
1331 libinput_event_gesture_get_scale(struct libinput_event_gesture *event);
1332 
1354 double
1355 libinput_event_gesture_get_angle_delta(struct libinput_event_gesture *event);
1356 
1368 struct libinput_event *
1370 
1388 int
1390  struct libinput_event_tablet_tool *event);
1391 
1409 int
1411  struct libinput_event_tablet_tool *event);
1412 
1430 int
1432  struct libinput_event_tablet_tool *event);
1433 
1453 int
1455  struct libinput_event_tablet_tool *event);
1456 
1474 int
1476  struct libinput_event_tablet_tool *event);
1477 
1495 int
1497  struct libinput_event_tablet_tool *event);
1515 int
1517  struct libinput_event_tablet_tool *event);
1535 int
1537  struct libinput_event_tablet_tool *event);
1555 int
1557  struct libinput_event_tablet_tool *event);
1558 
1573 double
1575 
1590 double
1592 
1607 double
1609 
1624 double
1626 
1638 double
1640 
1652 double
1654 
1670 double
1672 
1688 double
1690 
1708 double
1710 
1724 double
1726 
1737 double
1739  struct libinput_event_tablet_tool *event);
1740 
1751 int
1753  struct libinput_event_tablet_tool *event);
1754 
1772 double
1774  uint32_t width);
1775 
1793 double
1795  uint32_t height);
1796 
1814 struct libinput_tablet_tool *
1816 
1831 
1845 
1858 uint32_t
1860 
1874 
1888 uint32_t
1890 
1897 uint32_t
1899 
1906 uint64_t
1908 
1922 
1939 uint64_t
1941 
1953 struct libinput_tablet_tool *
1955 
1967 struct libinput_tablet_tool *
1969 
1978 int
1980 
1989 int
1991 
2000 int
2002 
2011 int
2013 
2022 int
2024 
2033 int
2035 
2047 int
2049  uint32_t code);
2050 
2065 int
2067 
2080 uint64_t
2082 
2093 void *
2095 
2104 void
2106  void *user_data);
2107 
2135  int (*open_restricted)(const char *path, int flags, void *user_data);
2143  void (*close_restricted)(int fd, void *user_data);
2144 };
2145 
2159 struct libinput *
2160 libinput_udev_create_context(const struct libinput_interface *interface,
2161  void *user_data,
2162  struct udev *udev);
2163 
2185 int
2187  const char *seat_id);
2188 
2208 struct libinput *
2209 libinput_path_create_context(const struct libinput_interface *interface,
2210  void *user_data);
2211 
2232 struct libinput_device *
2234  const char *path);
2235 
2254 void
2256 
2265 int
2267 
2285 int
2287 
2299 struct libinput_event *
2301 
2315 
2327 void
2329  void *user_data);
2330 
2340 void *
2342 
2354 int
2356 
2366 void
2368 
2378 struct libinput *
2379 libinput_ref(struct libinput *libinput);
2380 
2411 struct libinput *
2413 
2429 void
2431  enum libinput_log_priority priority);
2432 
2449 
2464 typedef void (*libinput_log_handler)(struct libinput *libinput,
2465  enum libinput_log_priority priority,
2466  const char *format, va_list args)
2468 
2484 void
2485 libinput_log_set_handler(struct libinput *libinput,
2486  libinput_log_handler log_handler);
2487 
2508 struct libinput_seat *
2509 libinput_seat_ref(struct libinput_seat *seat);
2510 
2522 struct libinput_seat *
2523 libinput_seat_unref(struct libinput_seat *seat);
2524 
2536 void
2537 libinput_seat_set_user_data(struct libinput_seat *seat, void *user_data);
2538 
2548 void *
2550 
2559 struct libinput *
2561 
2578 const char *
2580 
2590 const char *
2592 
2608 struct libinput_device *
2609 libinput_device_ref(struct libinput_device *device);
2610 
2622 struct libinput_device *
2623 libinput_device_unref(struct libinput_device *device);
2624 
2636 void
2637 libinput_device_set_user_data(struct libinput_device *device, void *user_data);
2638 
2648 void *
2650 
2659 struct libinput *
2661 
2722 struct libinput_device_group *
2724 
2736 const char *
2738 
2752 const char *
2754 
2763 unsigned int
2765 
2774 unsigned int
2776 
2788 const char *
2790 
2805 struct libinput_seat *
2807 
2833 int
2835  const char *name);
2836 
2856 struct udev_device *
2858 
2869 void
2871  enum libinput_led leds);
2872 
2880 int
2882  enum libinput_device_capability capability);
2883 
2898 int
2900  double *width,
2901  double *height);
2902 
2915 int
2916 libinput_device_pointer_has_button(struct libinput_device *device, uint32_t code);
2917 
2930 int
2932  uint32_t code);
2933 
2946 struct libinput_device_group *
2948 
2962 struct libinput_device_group *
2964 
2976 void
2978  void *user_data);
2979 
2990 void *
2992 
3017 };
3018 
3028 const char *
3030 
3039 };
3040 
3056 int
3058 
3081  enum libinput_config_tap_state enable);
3082 
3101 
3118 
3137 };
3138 
3156  enum libinput_config_drag_state enable);
3157 
3173 
3191 
3200 };
3201 
3226  enum libinput_config_drag_lock_state enable);
3227 
3247 
3270 
3283 int
3285 
3337  const float matrix[6]);
3338 
3355 int
3357  float matrix[6]);
3358 
3378 int
3380  float matrix[6]);
3381 
3415 };
3416 
3431 uint32_t
3433 
3464  uint32_t mode);
3465 
3485 uint32_t
3487 
3501 uint32_t
3503 
3513 int
3515 
3534  double speed);
3535 
3547 double
3549 
3560 double
3562 
3577 
3583 };
3584 
3595 uint32_t
3597 
3611  enum libinput_config_accel_profile mode);
3612 
3624 
3636 
3666 int
3668 
3685  int enable);
3699 int
3701 
3715 int
3717 
3731 int
3733 
3759  int left_handed);
3760 
3774 int
3776 
3790 int
3792 
3815 };
3816 
3832 uint32_t
3834 
3857  enum libinput_config_click_method method);
3875 
3893 
3908 };
3909 
3930 int
3932  struct libinput_device *device);
3933 
3966  struct libinput_device *device,
3968 
3991  struct libinput_device *device);
3992 
4016  struct libinput_device *device);
4017 
4045 };
4046 
4064 uint32_t
4066 
4093  enum libinput_config_scroll_method method);
4094 
4113 
4132 
4170  uint32_t button);
4171 
4196 uint32_t
4198 
4219 uint32_t
4221 
4231 };
4232 
4248 int
4250 
4274  enum libinput_config_dwt_state enable);
4275 
4293 
4311 
4312 #ifdef __cplusplus
4313 }
4314 #endif
4315 #endif /* LIBINPUT_H */
Definition: libinput.h:345
libinput_config_dwt_state
Possible states for the disable-while-typing feature.
Definition: libinput.h:4228
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:3902
A base handle for accessing libinput devices.
Definition: libinput.h:357
Never send scroll events instead of pointer motion events.
Definition: libinput.h:4029
Placeholder for devices that don't have a configurable pointer acceleration profile.
Definition: libinput.h:3568
uint32_t libinput_device_config_accel_get_profiles(struct libinput_device *device)
Returns a bitmask of the configurable acceleration modes available on this device.
Signals that a tool has come in or out of proximity of a device with the LIBINPUT_DEVICE_CAP_TABLET_T...
Definition: libinput.h:306
int libinput_event_tablet_tool_pressure_has_changed(struct libinput_event_tablet_tool *event)
Check if the pressure axis was updated in this event.
uint32_t libinput_event_tablet_tool_get_time(struct libinput_event_tablet_tool *event)
An airbrush-like tool.
Definition: libinput.h:180
unsigned int libinput_device_get_id_product(struct libinput_device *device)
Get the product ID for this device.
Definition: libinput.h:60
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 posi...
uint32_t libinput_event_pointer_get_button(struct libinput_event_pointer *event)
Return the button that triggered this event.
Definition: libinput.h:256
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...
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...
libinput does not open file descriptors to devices directly, instead open_restricted() and close_rest...
Definition: libinput.h:2123
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:3814
libinput_config_accel_profile
Definition: libinput.h:3563
Definition: libinput.h:252
Drag is to be enabled, or is currently enabled.
Definition: libinput.h:3136
Definition: libinput.h:95
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].
libinput_led
Mask reflecting LEDs on a device.
Definition: libinput.h:81
libinput_pointer_axis_source
The source for a libinput_pointer_axis event.
Definition: libinput.h:121
Touch event representing a touch down, move or up, as well as a touch cancel and touch frame events...
Definition: libinput.h:422
struct libinput_event * libinput_event_gesture_get_base_event(struct libinput_event_gesture *event)
Definition: libinput.h:254
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 curr...
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:112
libinput_tablet_tool_type
Available tool types for a device with the LIBINPUT_DEVICE_CAP_TABLET_TOOL capability.
Definition: libinput.h:174
Signals the end of a set of touchpoints at one device sample time.
Definition: libinput.h:262
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.
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.
uint64_t libinput_event_keyboard_get_time_usec(struct libinput_event_keyboard *event)
Config applied successfully.
Definition: libinput.h:3013
int libinput_tablet_tool_has_pressure(struct libinput_tablet_tool *tool)
Return whether the tablet tool supports pressure.
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.
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.
Definition: libinput.h:84
Use software-button areas (see Clickfinger behavior) to generate button events.
Definition: libinput.h:3810
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...
struct libinput_tablet_tool * libinput_tablet_tool_unref(struct libinput_tablet_tool *tool)
Decrement the reference count of the tool by one.
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.
double libinput_event_tablet_tool_get_dy(struct libinput_event_tablet_tool *event)
Return the delta between the last event and the current event.
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:130
libinput_config_drag_state
A config status to distinguish or set dragging on a device.
Definition: libinput.h:3126
Tapping is to be enabled, or is currently enabled.
Definition: libinput.h:3037
uint64_t libinput_tablet_tool_get_serial(struct libinput_tablet_tool *tool)
Return the serial number of a tool.
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:3805
int libinput_event_tablet_tool_x_has_changed(struct libinput_event_tablet_tool *event)
Check if the x axis was updated in this event.
Definition: libinput.h:247
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:2464
struct libinput_tablet_tool * libinput_event_tablet_tool_get_tool(struct libinput_event_tablet_tool *event)
Returns the tool that was in use during this event.
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].
Definition: libinput.h:346
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...
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.
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...
Signals that a device has been added to the context.
Definition: libinput.h:239
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:3014
void(* close_restricted)(int fd, void *user_data)
Close the file descriptor.
Definition: libinput.h:2143
libinput_tablet_tool_proximity_state
The state of proximity for a tool on a device.
Definition: libinput.h:199
Definition: libinput.h:249
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:245
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.
enum libinput_button_state libinput_event_tablet_tool_get_button_state(struct libinput_event_tablet_tool *event)
Return the button state of the event.
Definition: libinput.h:347
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:3388
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:93
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.
int libinput_event_tablet_tool_wheel_has_changed(struct libinput_event_tablet_tool *event)
Check if the wheel axis was updated in this event.
struct libinput_device * libinput_device_ref(struct libinput_device *device)
Increase the refcount of the input device.
enum libinput_tablet_tool_type libinput_tablet_tool_get_type(struct libinput_tablet_tool *tool)
Return the type of tool type for a tool object, see Vendor-specific tablet tool types for details...
Send scroll events when two fingers are logically down on the device.
Definition: libinput.h:4034
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:413
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...
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.
Signals that a tool has come in contact with the surface of a device with the LIBINPUT_DEVICE_CAP_TAB...
Definition: libinput.h:329
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_tablet_tool_is_unique(struct libinput_tablet_tool *tool)
Return nonzero if the physical tool can be uniquely identified by libinput, or nonzero otherwise...
int libinput_device_config_calibration_get_matrix(struct libinput_device *device, float matrix[6])
Return the current calibration matrix for this device.
libinput_tablet_tool_tip_state
The tip contact state for a tool on a device.
Definition: libinput.h:213
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.
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.
Definition: libinput.h:251
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:110
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:3034
A mouse tool with a lens.
Definition: libinput.h:182
Definition: libinput.h:58
void libinput_set_user_data(struct libinput *libinput, void *user_data)
Set caller-specific data associated with this context.
Eraser.
Definition: libinput.h:176
An object representing a tool being used by a device with the LIBINPUT_DEVICE_CAP_TABLET_TOOL capabil...
A generic pen.
Definition: libinput.h:175
Middle mouse button emulation is to be enabled, or is currently enabled.
Definition: libinput.h:3907
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:72
libinput_device_capability
Capabilities on a device.
Definition: libinput.h:57
The event is caused by the rotation of a wheel.
Definition: libinput.h:125
Definition: libinput.h:255
libinput_config_status
Status codes returned when applying configuration settings.
Definition: libinput.h:3012
int libinput_event_tablet_tool_distance_has_changed(struct libinput_event_tablet_tool *event)
Check if the distance axis was updated in this event.
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.
Definition: libinput.h:73
Definition: libinput.h:343
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...
struct libinput_event * libinput_event_tablet_tool_get_base_event(struct libinput_event_tablet_tool *event)
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.
double libinput_event_tablet_tool_get_wheel_delta(struct libinput_event_tablet_tool *event)
Return the delta for the wheel in degrees.
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_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.
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().
Tablet tool event representing an axis update, button press, or tool update.
Definition: libinput.h:434
uint64_t libinput_event_tablet_tool_get_time_usec(struct libinput_event_tablet_tool *event)
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.
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.
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:3199
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:61
Definition: libinput.h:257
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:385
#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:3800
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.
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.
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.
A base handle for accessing libinput device groups.
Definition: libinput.h:366
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...
A paintbrush-like tool.
Definition: libinput.h:177
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:3394
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:4229
struct libinput * libinput_device_get_context(struct libinput_device *device)
Get the libinput context from the device.
Invalid parameter range.
Definition: libinput.h:3016
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.
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 press...
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.
double libinput_event_tablet_tool_get_dx(struct libinput_event_tablet_tool *event)
Return the delta between the last event and the current 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:3197
Definition: libinput.h:59
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.
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).
int libinput_tablet_tool_has_wheel(struct libinput_tablet_tool *tool)
Return whether the tablet tool has a relative wheel.
One or more axes have changed state on a device with the LIBINPUT_DEVICE_CAP_TABLET_TOOL capability...
Definition: libinput.h:281
void libinput_event_destroy(struct libinput_event *event)
Destroy the event, freeing all associated resources.
Definition: libinput.h:250
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.
Physical drawing tool, e.g.
Definition: libinput.h:178
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.
Drag is to be disabled, or is currently disabled.
Definition: libinput.h:3131
int libinput_device_config_scroll_has_natural_scroll(struct libinput_device *device)
Return non-zero if the device supports "natural scrolling".
Definition: libinput.h:82
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.
struct libinput_event_tablet_tool * libinput_event_get_tablet_tool_event(struct libinput_event *event)
Return the tablet tool event that is this input event.
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:4044
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:4024
Send scroll events when a finger moves along the bottom or right edge of a device.
Definition: libinput.h:4039
Tapping is to be disabled, or is currently disabled.
Definition: libinput.h:3035
Definition: libinput.h:94
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.
struct libinput_tablet_tool * libinput_tablet_tool_ref(struct libinput_tablet_tool *tool)
Increment the reference count of the tool by one.
int libinput_resume(struct libinput *libinput)
Resume a suspended libinput context.
int libinput_tablet_tool_has_slider(struct libinput_tablet_tool *tool)
Return whether the tablet tool has a slider axis.
Definition: libinput.h:344
The base handle for accessing libinput seats.
Definition: libinput.h:376
Definition: libinput.h:62
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:223
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:134
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...
int libinput_event_tablet_tool_slider_has_changed(struct libinput_event_tablet_tool *event)
Check if the slider axis was updated in this event.
uint32_t libinput_event_keyboard_get_time(struct libinput_event_keyboard *event)
Do not send events through this device.
Definition: libinput.h:3408
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 curr...
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:201
Definition: libinput.h:83
int libinput_device_config_accel_is_available(struct libinput_device *device)
Check if a device uses libinput-internal pointer-acceleration.
int libinput_tablet_tool_has_rotation(struct libinput_tablet_tool *tool)
Return whether the tablet tool supports z-rotation.
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:3897
struct libinput_seat * libinput_device_get_seat(struct libinput_device *device)
Get the seat associated with this input device, see Seats for details.
uint32_t libinput_event_tablet_tool_get_button(struct libinput_event_tablet_tool *event)
Return the button that triggered this event.
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:111
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:342
An adaptive acceleration profile.
Definition: libinput.h:3582
int libinput_tablet_tool_has_distance(struct libinput_tablet_tool *tool)
Return whether the tablet tool supports distance.
void(*) voi libinput_log_set_handler)(struct libinput *libinput, libinput_log_handler log_handler)
Set the context's log handler.
Definition: libinput.h:2485
enum libinput_log_priority libinput_log_get_priority(const struct libinput *libinput)
Get the context's log priority.
Signals that a tool has changed a logical button state on a device with the LIBINPUT_DEVICE_CAP_TABLE...
Definition: libinput.h:340
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:3195
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.
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.
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:3414
void * libinput_tablet_tool_get_user_data(struct libinput_tablet_tool *tool)
Return the user data associated with a tool object.
libinput_log_priority
Log priority for internal logging messages.
Definition: libinput.h:45
A mouse bound to the tablet.
Definition: libinput.h:181
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...
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.
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:2135
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:397
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.
Definition: libinput.h:214
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:71
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:229
void libinput_device_set_user_data(struct libinput_device *device, void *user_data)
Set caller-specific data associated with this input device.
int libinput_tablet_tool_has_tilt(struct libinput_tablet_tool *tool)
Return whether the tablet tool supports tilt.
Definition: libinput.h:215
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:3576
A keyboard event representing a key press/release.
Definition: libinput.h:405
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.
int libinput_event_tablet_tool_y_has_changed(struct libinput_event_tablet_tool *event)
Check if the y axis was updated in this 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:4230
struct libinput_event_touch * libinput_event_get_touch_event(struct libinput_event *event)
Return the touch event that is this input event.
uint64_t libinput_tablet_tool_get_tool_id(struct libinput_tablet_tool *tool)
Return the tool ID for a tool object.