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 <stdarg.h>
35 #include <libudev.h>
36 
37 #define LIBINPUT_ATTRIBUTE_PRINTF(_format, _args) \
38  __attribute__ ((format (printf, _format, _args)))
39 #define LIBINPUT_ATTRIBUTE_DEPRECATED __attribute__ ((deprecated))
40 
48 struct libinput;
49 
58 
68 
77 
97 
109 
117 
125 
134 
146 
160 
173 
183 };
184 
199 };
200 
210 };
211 
221 };
222 
232 };
233 
249 };
250 
287 };
288 
304 };
305 
321 };
322 
357 };
358 
378 };
379 
394 };
395 
424 
440 int
442 
467  unsigned int index);
468 
481 unsigned int
483 
501 unsigned int
503 
523 unsigned int
525 
538 int
540  unsigned int button);
541 
554 int
556  unsigned int ring);
557 
570 int
572  unsigned int strip);
573 
592 int
594  unsigned int button);
595 
609  struct libinput_tablet_pad_mode_group *group);
610 
624  struct libinput_tablet_pad_mode_group *group);
625 
639 void
641  struct libinput_tablet_pad_mode_group *group,
642  void *user_data);
643 
655 void *
657  struct libinput_tablet_pad_mode_group *group);
658 
673 };
674 
689 
705 };
706 
715 struct libinput_event_switch;
716 
729 
739 
745 
747 
781 
795 
809 
824 
834 
925 
949 
957 
970 
982 
987 };
988 
1005 void
1006 libinput_event_destroy(struct libinput_event *event);
1007 
1017 
1026 struct libinput *
1028 
1042 struct libinput_device *
1044 
1055 struct libinput_event_pointer *
1057 
1068 struct libinput_event_keyboard *
1070 
1081 struct libinput_event_touch *
1083 
1101 struct libinput_event_gesture *
1103 
1118 
1131 
1144 struct libinput_event_switch *
1146 
1160 
1166 struct libinput_event *
1168 
1184 uint32_t
1186 
1195 uint64_t
1197 
1203 uint32_t
1205 
1211 enum libinput_key_state
1213 
1219 struct libinput_event *
1221 
1234 uint32_t
1236  struct libinput_event_keyboard *event);
1237 
1253 uint32_t
1255 
1264 uint64_t
1266 
1285 double
1287 
1306 double
1308 
1330 double
1332  struct libinput_event_pointer *event);
1333 
1355 double
1357  struct libinput_event_pointer *event);
1358 
1374 double
1376 
1392 double
1394 
1412 double
1414  struct libinput_event_pointer *event,
1415  uint32_t width);
1416 
1434 double
1436  struct libinput_event_pointer *event,
1437  uint32_t height);
1438 
1451 uint32_t
1453 
1468 
1482 uint32_t
1484  struct libinput_event_pointer *event);
1485 
1508 int
1510  enum libinput_pointer_axis axis);
1511 
1536 double
1538  enum libinput_pointer_axis axis);
1539 
1588 
1614 double
1616  enum libinput_pointer_axis axis);
1617 
1666 double
1668  enum libinput_pointer_axis axis);
1669 
1706 double
1708  enum libinput_pointer_axis axis);
1709 
1715 struct libinput_event *
1717 
1732 uint32_t
1734 
1743 uint64_t
1745 
1765 int32_t
1767 
1787 int32_t
1789 
1807 double
1809 
1827 double
1829 
1847 double
1849  uint32_t width);
1850 
1868 double
1870  uint32_t height);
1871 
1877 struct libinput_event *
1879 
1902 uint32_t
1903 libinput_event_gesture_get_time(struct libinput_event_gesture *event);
1904 
1913 uint64_t
1914 libinput_event_gesture_get_time_usec(struct libinput_event_gesture *event);
1915 
1921 struct libinput_event *
1922 libinput_event_gesture_get_base_event(struct libinput_event_gesture *event);
1923 
1939 int
1940 libinput_event_gesture_get_finger_count(struct libinput_event_gesture *event);
1941 
1956 int
1957 libinput_event_gesture_get_cancelled(struct libinput_event_gesture *event);
1958 
1974 double
1975 libinput_event_gesture_get_dx(struct libinput_event_gesture *event);
1976 
1992 double
1993 libinput_event_gesture_get_dy(struct libinput_event_gesture *event);
1994 
2013 double
2015  struct libinput_event_gesture *event);
2016 
2035 double
2037  struct libinput_event_gesture *event);
2038 
2065 double
2066 libinput_event_gesture_get_scale(struct libinput_event_gesture *event);
2067 
2089 double
2090 libinput_event_gesture_get_angle_delta(struct libinput_event_gesture *event);
2091 
2116 struct libinput_event *
2118 
2138 int
2140  struct libinput_event_tablet_tool *event);
2141 
2161 int
2163  struct libinput_event_tablet_tool *event);
2164 
2184 int
2186  struct libinput_event_tablet_tool *event);
2187 
2209 int
2211  struct libinput_event_tablet_tool *event);
2212 
2232 int
2234  struct libinput_event_tablet_tool *event);
2235 
2255 int
2257  struct libinput_event_tablet_tool *event);
2277 int
2279  struct libinput_event_tablet_tool *event);
2299 int
2301  struct libinput_event_tablet_tool *event);
2302 
2320 int
2322  struct libinput_event_tablet_tool *event);
2323 
2341 int
2343  struct libinput_event_tablet_tool *event);
2344 
2364 int
2366  struct libinput_event_tablet_tool *event);
2367 
2384 double
2386 
2403 double
2405 
2422 double
2424 
2441 double
2443 
2457 double
2459 
2473 double
2475 
2493 double
2495 
2513 double
2515 
2535 double
2537 
2553 double
2555 
2571 double
2573 
2589 double
2591 
2602 double
2604  struct libinput_event_tablet_tool *event);
2605 
2618 int
2620  struct libinput_event_tablet_tool *event);
2621 
2641 double
2643  uint32_t width);
2644 
2664 double
2666  uint32_t height);
2667 
2690 struct libinput_tablet_tool *
2692 
2721 
2737 
2752 uint32_t
2754 
2770 
2786 uint32_t
2788 
2800 uint32_t
2802 
2814 uint64_t
2816 
2842 
2862 uint64_t
2864 
2878 struct libinput_tablet_tool *
2880 
2895 struct libinput_tablet_tool *
2897 
2908 int
2910 
2921 int
2923 
2934 int
2936 
2947 int
2949 
2960 int
2962 
2974 int
2976 
2987 int
2989 
3003 int
3005  uint32_t code);
3006 
3023 int
3025 
3062 uint64_t
3064 
3077 void *
3079 
3090 void
3092  void *user_data);
3093 
3110 struct libinput_event *
3112 
3135 double
3137 
3154 unsigned int
3156 
3175 
3198 double
3200 
3217 unsigned int
3219 
3238 
3259 uint32_t
3261 
3278 
3297 uint32_t
3299 
3314 enum libinput_key_state
3316 
3349 unsigned int
3351 
3377 
3389 uint32_t
3391 
3403 uint64_t
3405 
3427 enum libinput_switch
3429 
3447 
3455 struct libinput_event *
3457 
3469 uint32_t
3471 
3483 uint64_t
3485 
3513  int (*open_restricted)(const char *path, int flags, void *user_data);
3521  void (*close_restricted)(int fd, void *user_data);
3522 };
3523 
3537 struct libinput *
3538 libinput_udev_create_context(const struct libinput_interface *interface,
3539  void *user_data,
3540  struct udev *udev);
3541 
3563 int
3565  const char *seat_id);
3566 
3586 struct libinput *
3587 libinput_path_create_context(const struct libinput_interface *interface,
3588  void *user_data);
3589 
3610 struct libinput_device *
3612  const char *path);
3613 
3632 void
3634 
3643 int
3645 
3663 int
3665 
3677 struct libinput_event *
3679 
3693 
3705 void
3707  void *user_data);
3708 
3719 void *
3721 
3733 int
3735 
3745 void
3747 
3757 struct libinput *
3758 libinput_ref(struct libinput *libinput);
3759 
3791 struct libinput *
3793 
3809 void
3811  enum libinput_log_priority priority);
3812 
3829 
3844 typedef void (*libinput_log_handler)(struct libinput *libinput,
3845  enum libinput_log_priority priority,
3846  const char *format, va_list args)
3848 
3864 void
3865 libinput_log_set_handler(struct libinput *libinput,
3866  libinput_log_handler log_handler);
3867 
3889 struct libinput_seat *
3890 libinput_seat_ref(struct libinput_seat *seat);
3891 
3903 struct libinput_seat *
3904 libinput_seat_unref(struct libinput_seat *seat);
3905 
3917 void
3918 libinput_seat_set_user_data(struct libinput_seat *seat, void *user_data);
3919 
3929 void *
3931 
3940 struct libinput *
3942 
3959 const char *
3961 
3971 const char *
3973 
3989 struct libinput_device *
3990 libinput_device_ref(struct libinput_device *device);
3991 
4003 struct libinput_device *
4004 libinput_device_unref(struct libinput_device *device);
4005 
4017 void
4018 libinput_device_set_user_data(struct libinput_device *device, void *user_data);
4019 
4029 void *
4031 
4040 struct libinput *
4042 
4103 struct libinput_device_group *
4105 
4117 const char *
4119 
4133 const char *
4135 
4144 unsigned int
4146 
4155 unsigned int
4157 
4177 const char *
4179 
4200 struct libinput_seat *
4202 
4228 int
4230  const char *name);
4231 
4251 struct udev_device *
4253 
4264 void
4266  enum libinput_led leds);
4267 
4275 int
4277  enum libinput_device_capability capability);
4278 
4293 int
4295  double *width,
4296  double *height);
4297 
4310 int
4311 libinput_device_pointer_has_button(struct libinput_device *device, uint32_t code);
4312 
4325 int
4327  uint32_t code);
4328 
4342 int
4344 
4359 int
4361  enum libinput_switch sw);
4362 
4377 int
4379 
4394 int
4396 
4411 int
4413 
4428 int
4430  uint32_t code);
4431 
4444 struct libinput_device_group *
4446 
4460 struct libinput_device_group *
4462 
4474 void
4476  void *user_data);
4477 
4488 void *
4490 
4542 };
4543 
4553 const char *
4555 
4564 };
4565 
4581 int
4583 
4606  enum libinput_config_tap_state enable);
4607 
4626 
4643 
4654 };
4655 
4689 
4711 
4733 
4754 };
4755 
4775  enum libinput_config_drag_state enable);
4776 
4794 
4814 
4823 };
4824 
4849  enum libinput_config_drag_lock_state enable);
4850 
4870 
4893 
4906 int
4908 
4960  const float matrix[6]);
4961 
4978 int
4980  float matrix[6]);
4981 
5002 int
5004  float matrix[6]);
5005 
5039 };
5040 
5055 uint32_t
5057 
5088  uint32_t mode);
5089 
5109 uint32_t
5111 
5125 uint32_t
5127 
5141 int
5143 
5166  double speed);
5167 
5189 double
5191 
5206 double
5208 
5228 
5234 
5243 };
5244 
5270 struct libinput_config_accel;
5271 
5293 struct libinput_config_accel *
5295 
5310 void
5311 libinput_config_accel_destroy(struct libinput_config_accel *accel_config);
5312 
5333  struct libinput_config_accel *accel_config);
5334 
5372 };
5373 
5405 libinput_config_accel_set_points(struct libinput_config_accel *accel_config,
5406  enum libinput_config_accel_type accel_type,
5407  double step, size_t npoints, double *points);
5408 
5421 uint32_t
5423 
5439  enum libinput_config_accel_profile profile);
5440 
5454 
5468 
5498 int
5500 
5517  int enable);
5531 int
5533 
5547 int
5549 
5563 int
5565 
5591  int left_handed);
5592 
5606 int
5608 
5622 int
5624 
5646 };
5647 
5663 uint32_t
5665 
5688  enum libinput_config_click_method method);
5706 
5724 
5739 };
5740 
5761 int
5763  struct libinput_device *device);
5764 
5789  struct libinput_device *device,
5791 
5817  struct libinput_device *device);
5818 
5845  struct libinput_device *device);
5846 
5874 };
5875 
5893 uint32_t
5895 
5922  enum libinput_config_scroll_method method);
5923 
5942 
5961 
5999  uint32_t button);
6000 
6025 uint32_t
6027 
6048 uint32_t
6050 
6054 };
6055 
6080 
6105 
6125 
6134 };
6135 
6151 int
6153 
6177  enum libinput_config_dwt_state enable);
6178 
6196 
6214 
6225 };
6226 
6245 int
6247 
6273  enum libinput_config_dwtp_state enable);
6274 
6294 
6314 
6329 int
6331 
6361  unsigned int degrees_cw);
6362 
6379 unsigned int
6381 
6398 unsigned int
6400 
6401 #ifdef __cplusplus
6402 }
6403 #endif
6404 #endif /* LIBINPUT_H */
Definition: libinput.h:974
libinput_config_dwt_state
Possible states for the disable-while-typing feature.
Definition: libinput.h:6131
const char * libinput_seat_get_physical_name(struct libinput_seat *seat)
Return the physical name of the seat.
struct libinput_event * libinput_event_tablet_pad_get_base_event(struct libinput_event_tablet_pad *event)
enum libinput_config_status libinput_device_config_accel_set_profile(struct libinput_device *device, enum libinput_config_accel_profile profile)
Set the pointer acceleration profile of this pointer device to the given mode.
A custom acceleration profile.
Definition: libinput.h:5242
Middle mouse button emulation is to be disabled, or is currently disabled.
Definition: libinput.h:5733
enum libinput_tablet_pad_ring_axis_source libinput_event_tablet_pad_get_ring_source(struct libinput_event_tablet_pad *event)
Returns the source of the interaction with the ring.
A base handle for accessing libinput devices.
Definition: libinput.h:48
Never send scroll events instead of pointer motion events.
Definition: libinput.h:5858
libinput_config_accel_type
Acceleration types are categories of movement by a device that may have specific acceleration functio...
Definition: libinput.h:5356
Definition: libinput.h:6224
Definition: libinput.h:671
struct libinput_event_tablet_pad * libinput_event_get_tablet_pad_event(struct libinput_event *event)
Return the tablet pad event that is this input event.
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:881
uint64_t libinput_event_switch_get_time_usec(struct libinput_event_switch *event)
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:351
unsigned int libinput_device_get_id_product(struct libinput_device *device)
Get the product ID for this device.
Definition: libinput.h:194
libinput_config_accel_profile
Definition: libinput.h:5214
uint32_t libinput_event_switch_get_time(struct libinput_event_switch *event)
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.
double libinput_event_tablet_pad_get_strip_position(struct libinput_event_tablet_pad *event)
Returns the current position of the strip, normalized to the range [0, 1], with 0 being the top/left-...
Definition: libinput.h:827
enum libinput_config_status libinput_device_config_rotation_set_angle(struct libinput_device *device, unsigned int degrees_cw)
Set the rotation of a device in degrees clockwise off the logical neutral position.
int libinput_dispatch(struct libinput *libinput)
Main event dispatchment function.
struct libinput * libinput_ref(struct libinput *libinput)
Add a reference to the context.
struct libinput_tablet_pad_mode_group * libinput_tablet_pad_mode_group_unref(struct libinput_tablet_pad_mode_group *group)
Decrease the refcount of the mode group.
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...
int libinput_device_tablet_pad_has_key(struct libinput_device *device, uint32_t code)
Check if a LIBINPUT_DEVICE_CAP_TABLET_PAD device has a key with the given code (see linux/input-event...
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:3501
Definition: libinput.h:196
Definition: libinput.h:180
The number of fingers decides which button press to generate.
Definition: libinput.h:5645
A scroll event from various sources.
Definition: libinput.h:780
Drag is to be enabled, or is currently enabled.
Definition: libinput.h:4753
Definition: libinput.h:231
libinput_switch_state
The state of a switch.
Definition: libinput.h:670
A rotary device with positional and rotation data.
Definition: libinput.h:354
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].
int libinput_device_config_rotation_is_available(struct libinput_device *device)
Check whether a device can have a custom rotation applied.
libinput_led
Mask reflecting LEDs on a device.
Definition: libinput.h:217
libinput_pointer_axis_source
The source for a libinput_pointer_axis event.
Definition: libinput.h:263
enum libinput_config_scroll_button_lock_state libinput_device_config_scroll_get_button_lock(struct libinput_device *device)
Get the current scroll button lock state.
Touch event representing a touch down, move or up, as well as a touch cancel and touch frame events...
Definition: libinput.h:133
struct libinput_event * libinput_event_gesture_get_base_event(struct libinput_event_gesture *event)
unsigned int libinput_device_config_rotation_get_default_angle(struct libinput_device *device)
Get the default rotation of a device in degrees clockwise off the logical neutral position...
Definition: libinput.h:980
Definition: libinput.h:825
double libinput_event_tablet_pad_get_ring_position(struct libinput_event_tablet_pad *event)
Returns the current position of the ring, in degrees counterclockwise from the northern-most point of...
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.
enum libinput_config_status libinput_device_config_tap_set_button_map(struct libinput_device *device, enum libinput_config_tap_button_map map)
Set the finger number to button number mapping for tap-to-click.
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:248
libinput_tablet_tool_type
Available tool types for a device with the LIBINPUT_DEVICE_CAP_TABLET_TOOL capability.
Definition: libinput.h:345
Signals the end of a set of touchpoints at one device sample time.
Definition: libinput.h:833
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:4538
int libinput_tablet_tool_has_pressure(struct libinput_tablet_tool *tool)
Return whether the tablet tool supports pressure.
A switch event representing a changed state in a switch.
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:6223
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:220
Use software-button areas to generate button events.
Definition: libinput.h:5641
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...
uint32_t libinput_event_tablet_pad_get_button_number(struct libinput_event_tablet_pad *event)
Return the button number that triggered this event, starting at 0.
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 tilting of a mouse wheel rather than its rotation.
Definition: libinput.h:286
The event is caused by the movement of one or more fingers on a device.
Definition: libinput.h:272
struct libinput_tablet_pad_mode_group * libinput_device_tablet_pad_get_mode_group(struct libinput_device *device, unsigned int index)
The returned mode group is not refcounted and may become invalid after the next call to libinput...
libinput_config_drag_state
A config status to distinguish or set dragging on a device.
Definition: libinput.h:4743
Tapping is to be enabled, or is currently enabled.
Definition: libinput.h:4562
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.
uint32_t libinput_event_tablet_pad_get_key(struct libinput_event_tablet_pad *event)
Return the key code that triggered this event, e.g.
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:5637
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:746
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:3844
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:975
int libinput_device_touch_get_touch_count(struct libinput_device *device)
Check how many touches a LIBINPUT_DEVICE_CAP_TOUCH device supports simultaneously.
enum libinput_config_tap_button_map libinput_device_config_tap_get_button_map(struct libinput_device *device)
Get the finger number to button number mapping for tap-to-click.
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:738
void libinput_tablet_pad_mode_group_set_user_data(struct libinput_tablet_pad_mode_group *group, void *user_data)
Set caller-specific data associated with this mode group.
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:4539
void(* close_restricted)(int fd, void *user_data)
Close the file descriptor.
Definition: libinput.h:3521
libinput_tablet_tool_proximity_state
The state of proximity for a tool on a device.
Definition: libinput.h:375
Definition: libinput.h:748
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.
A flat acceleration profile.
Definition: libinput.h:5227
int libinput_device_tablet_pad_get_num_buttons(struct libinput_device *device)
Return the number of buttons on a device with the LIBINPUT_DEVICE_CAP_TABLET_PAD capability.
uint32_t libinput_event_gesture_get_time(struct libinput_event_gesture *event)
enum libinput_config_status libinput_device_config_accel_apply(struct libinput_device *device, struct libinput_config_accel *accel_config)
Apply this pointer acceleration configuration to the device.
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:744
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:976
Definition: libinput.h:181
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:5012
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:229
const char * libinput_config_status_to_str(enum libinput_config_status status)
Return a string describing the error.
Definition: libinput.h:198
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 high-level tool type for a tool object.
Send scroll events when two fingers are logically down on the device.
Definition: libinput.h:5863
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:124
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:906
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:391
uint32_t libinput_event_tablet_pad_get_time(struct libinput_event_tablet_pad *event)
unsigned int libinput_tablet_pad_mode_group_get_mode(struct libinput_tablet_pad_mode_group *group)
Return the current mode this mode group is in.
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.
void * libinput_tablet_pad_mode_group_get_user_data(struct libinput_tablet_pad_mode_group *group)
Get the caller-specific data associated with this mode group, if any.
Definition: libinput.h:750
int libinput_device_config_dwtp_is_available(struct libinput_device *device)
Check if this device supports configurable disable-while-trackpointing feature.
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.
Acceleration type for regular pointer movement.
Definition: libinput.h:5366
A scroll event from a continuous scroll source, e.g.
Definition: libinput.h:823
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:246
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:4559
A mouse tool with a lens.
Definition: libinput.h:353
Definition: libinput.h:192
void libinput_set_user_data(struct libinput *libinput, void *user_data)
Set caller-specific data associated with this context.
Eraser.
Definition: libinput.h:347
An object representing a tool being used by a device with the LIBINPUT_DEVICE_CAP_TABLET_TOOL capabil...
Definition: libinput.h:76
int libinput_device_tablet_pad_get_num_rings(struct libinput_device *device)
Return the number of rings a device with the LIBINPUT_DEVICE_CAP_TABLET_PAD capability provides...
A generic pen.
Definition: libinput.h:346
Middle mouse button emulation is to be enabled, or is currently enabled.
Definition: libinput.h:5738
enum libinput_button_state libinput_event_tablet_pad_get_button_state(struct libinput_event_tablet_pad *event)
Return the button state of the event.
A mode on a tablet pad is a virtual grouping of functionality, usually based on some visual feedback ...
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:208
libinput_device_capability
Capabilities on a device.
Definition: libinput.h:191
The event is caused by the rotation of a wheel.
Definition: libinput.h:267
Definition: libinput.h:826
libinput_config_status
Status codes returned when applying configuration settings.
Definition: libinput.h:4537
int libinput_event_tablet_tool_distance_has_changed(struct libinput_event_tablet_tool *event)
Check if the distance axis was updated in this event.
enum libinput_config_tap_button_map libinput_device_config_tap_get_default_button_map(struct libinput_device *device)
Get the default finger number to button number mapping for tap-to-click.
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.
struct libinput_tablet_pad_mode_group * libinput_tablet_pad_mode_group_ref(struct libinput_tablet_pad_mode_group *group)
Increase the refcount of the mode group.
int libinput_event_tablet_tool_size_minor_has_changed(struct libinput_event_tablet_tool *event)
Check if the size minor axis was updated in this event.
Definition: libinput.h:209
libinput_tablet_pad_ring_axis_source
The source for a LIBINPUT_EVENT_TABLET_PAD_RING event.
Definition: libinput.h:297
Definition: libinput.h:972
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.
libinput_config_tap_button_map
Definition: libinput.h:4649
unsigned int libinput_event_tablet_pad_get_strip_number(struct libinput_event_tablet_pad *event)
Returns the number of the strip that has changed state, with 0 being the first strip.
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.
int libinput_device_tablet_pad_get_num_mode_groups(struct libinput_device *device)
Most devices only provide a single mode group, however devices such as the Wacom Cintiq 22HD provide ...
Definition: libinput.h:182
enum libinput_config_status libinput_config_accel_set_points(struct libinput_config_accel *accel_config, enum libinput_config_accel_type accel_type, double step, size_t npoints, double *points)
Defines the acceleration function for a given movement type in an acceleration configuration with the...
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.
Definition: libinput.h:986
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:145
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...
A key pressed on a device with the LIBINPUT_DEVICE_CAP_TABLET_PAD capability.
Definition: libinput.h:969
double libinput_event_gesture_get_dy(struct libinput_event_gesture *event)
Return the delta between the last event and the current event.
double libinput_event_pointer_get_scroll_value(struct libinput_event_pointer *event, enum libinput_pointer_axis axis)
Return the axis value of the given axis.
unsigned int libinput_event_tablet_pad_get_ring_number(struct libinput_event_tablet_pad *event)
Returns the number of the ring that has changed state, with 0 being the first ring.
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:4822
1/2/3 finger tap maps to left/middle/right
Definition: libinput.h:4653
The laptop lid was closed when the switch state is LIBINPUT_SWITCH_STATE_ON, or was opened when it is...
Definition: libinput.h:688
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:195
Definition: libinput.h:828
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:96
#define LIBINPUT_ATTRIBUTE_PRINTF(_format, _args)
Definition: libinput.h:37
libinput_config_click_method
The click method defines when to generate software-emulated buttons, usually on a device that does no...
Definition: libinput.h:5632
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:57
void libinput_config_accel_destroy(struct libinput_config_accel *accel_config)
Destroy an acceleration configuration.
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:348
A button pressed on a device with the LIBINPUT_DEVICE_CAP_TABLET_PAD capability.
Definition: libinput.h:941
The event is caused by the movement of one or more fingers on the ring.
Definition: libinput.h:303
unsigned int libinput_event_tablet_pad_get_mode(struct libinput_event_tablet_pad *event)
Returns the mode the button, ring, or strip that triggered this event is in, at the time of the event...
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:5018
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:6132
struct libinput * libinput_device_get_context(struct libinput_device *device)
Get the libinput context from the device.
Invalid parameter range.
Definition: libinput.h:4541
unsigned int libinput_device_get_id_vendor(struct libinput_device *device)
Get the vendor ID for this device.
int libinput_tablet_pad_mode_group_has_ring(struct libinput_tablet_pad_mode_group *group, unsigned int ring)
Devices without mode switching capabilities return true for every ring.
int libinput_tablet_pad_mode_group_button_is_toggle(struct libinput_tablet_pad_mode_group *group, unsigned int button)
The toggle button in a mode group is the button assigned to cycle to or directly assign a new mode wh...
struct libinput_event_switch * libinput_event_get_switch_event(struct libinput_event *event)
Return the switch event that is this input event.
The default acceleration type used as a fallback when other acceleration types are not provided...
Definition: libinput.h:5361
Acceleration type for scroll movement.
Definition: libinput.h:5371
Placeholder for devices that don't have a configurable pointer acceleration profile.
Definition: libinput.h:5219
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.
A status change on a tablet ring with the LIBINPUT_DEVICE_CAP_TABLET_PAD capability.
Definition: libinput.h:948
double libinput_event_gesture_get_dx(struct libinput_event_gesture *event)
Return the delta between the last event and the current event.
double libinput_event_pointer_get_scroll_value_v120(struct libinput_event_pointer *event, enum libinput_pointer_axis axis)
For events of type LIBINPUT_EVENT_POINTER_SCROLL_WHEEL the v120-normalized value represents the movem...
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.
libinput_switch
The type of a switch.
Definition: libinput.h:682
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.
int libinput_tablet_pad_mode_group_has_button(struct libinput_tablet_pad_mode_group *group, unsigned int button)
Devices without mode switching capabilities return true for every button.
A scroll event caused by the movement of one or more fingers on a device.
Definition: libinput.h:808
Drag lock is to be disabled, or is currently disabled.
Definition: libinput.h:4820
Definition: libinput.h:193
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:854
void libinput_event_destroy(struct libinput_event *event)
Destroy the event, freeing all associated resources.
Definition: libinput.h:749
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.
Tablet pad event representing a button press, or ring/strip update on the tablet pad itself...
Definition: libinput.h:159
Physical drawing tool, e.g.
Definition: libinput.h:349
void libinput_suspend(struct libinput *libinput)
Suspend monitoring for new devices and close existing devices.
struct libinput_event * libinput_event_switch_get_base_event(struct libinput_event_switch *event)
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:4748
int libinput_device_config_scroll_has_natural_scroll(struct libinput_device *device)
Return non-zero if the device supports "natural scrolling".
Definition: libinput.h:218
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)
enum libinput_config_scroll_button_lock_state libinput_device_config_scroll_get_default_button_lock(struct libinput_device *device)
Get the default scroll button lock state.
int libinput_device_tablet_pad_get_num_strips(struct libinput_device *device)
Return the number of strips a device with the LIBINPUT_DEVICE_CAP_TABLET_PAD capability provides...
uint64_t libinput_event_gesture_get_time_usec(struct libinput_event_gesture *event)
enum libinput_key_state libinput_event_tablet_pad_get_key_state(struct libinput_event_tablet_pad *event)
Return the key state of the 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:5873
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:5853
Send scroll events when a finger moves along the bottom or right edge of a device.
Definition: libinput.h:5868
Tapping is to be disabled, or is currently disabled.
Definition: libinput.h:4560
A scroll event from a wheel.
Definition: libinput.h:794
Definition: libinput.h:230
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.
unsigned int libinput_device_config_rotation_get_angle(struct libinput_device *device)
Get the current rotation of a device in degrees clockwise off the logical neutral position...
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:973
The base handle for accessing libinput seats.
Definition: libinput.h:67
Definition: libinput.h:197
uint64_t libinput_event_tablet_pad_get_time_usec(struct libinput_event_tablet_pad *event)
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:722
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.
double libinput_event_tablet_tool_get_size_minor(struct libinput_event_tablet_tool *event)
Returns the current size in mm along the minor axis of the touching ellipse.
The event is caused by the motion of some device.
Definition: libinput.h:276
Definition: libinput.h:672
This switch indicates whether the device is in normal laptop mode or behaves like a tablet-like devic...
Definition: libinput.h:704
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:5032
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:377
Definition: libinput.h:219
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:5728
struct libinput_seat * libinput_device_get_seat(struct libinput_device *device)
Get the seat associated with this input device.
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.
libinput_config_dwtp_state
Possible states for the disable-while-trackpointing feature.
Definition: libinput.h:6222
The event is caused by the movement of one or more fingers on the strip.
Definition: libinput.h:320
int libinput_tablet_pad_mode_group_has_strip(struct libinput_tablet_pad_mode_group *group, unsigned int strip)
Devices without mode switching capabilities return true for every strip.
Definition: libinput.h:247
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.
struct libinput_config_accel * libinput_config_accel_create(enum libinput_config_accel_profile profile)
Create an acceleration configuration of a given profile.
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:971
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:3865
enum libinput_log_priority libinput_log_get_priority(const struct libinput *libinput)
Get the context's log priority.
libinput_tablet_pad_strip_axis_source
The source for a LIBINPUT_EVENT_TABLET_PAD_STRIP event.
Definition: libinput.h:314
Signals that a tool has changed a logical button state on a device with the LIBINPUT_DEVICE_CAP_TABLE...
Definition: libinput.h:924
int libinput_tablet_tool_has_size(struct libinput_tablet_tool *tool)
Return whether the tablet tool has a ellipsis major and minor.
const char * libinput_device_get_sysname(struct libinput_device *device)
Get the system name of the device.
struct libinput_tablet_pad_mode_group * libinput_event_tablet_pad_get_mode_group(struct libinput_event_tablet_pad *event)
Returns the mode group that the button, ring, or strip that triggered this event is considered in...
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:4818
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.
A status change on a strip on a device with the LIBINPUT_DEVICE_CAP_TABLET_PAD capability.
Definition: libinput.h:956
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:5038
enum libinput_switch_state libinput_event_switch_get_switch_state(struct libinput_event_switch *event)
Return the switch state that triggered this event.
void * libinput_tablet_tool_get_user_data(struct libinput_tablet_tool *tool)
Return the user data associated with a tool object.
1/2/3 finger tap maps to left/right/middle
Definition: libinput.h:4651
libinput_config_scroll_button_lock_state
Definition: libinput.h:6051
int libinput_event_tablet_tool_size_major_has_changed(struct libinput_event_tablet_tool *event)
Check if the size major axis was updated in this event.
libinput_log_priority
Log priority for internal logging messages.
Definition: libinput.h:179
A mouse bound to the tablet.
Definition: libinput.h:352
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-event-c...
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...
double libinput_event_tablet_tool_get_size_major(struct libinput_event_tablet_tool *event)
Returns the current size in mm along the major axis of the touching ellipse.
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:3513
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:108
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.
enum libinput_config_dwtp_state libinput_device_config_dwtp_get_enabled(struct libinput_device *device)
Check if the disable-while trackpointing feature is currently enabled on this device.
unsigned int libinput_tablet_pad_mode_group_get_num_modes(struct libinput_tablet_pad_mode_group *group)
Query the mode group for the number of available modes.
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:392
Definition: libinput.h:981
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.
enum libinput_switch libinput_event_switch_get_switch(struct libinput_event_switch *event)
Return the switch that triggered this event.
enum libinput_config_dwtp_state libinput_device_config_dwtp_get_default_enabled(struct libinput_device *device)
Check if the disable-while trackpointing feature is enabled on this device by default.
enum libinput_config_status libinput_device_config_dwtp_set_enabled(struct libinput_device *device, enum libinput_config_dwtp_state enable)
Enable or disable the disable-while-trackpointing feature.
libinput_key_state
Logical state of a key.
Definition: libinput.h:207
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:728
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.
int libinput_device_switch_has_switch(struct libinput_device *device, enum libinput_switch sw)
Check if a LIBINPUT_DEVICE_CAP_SWITCH device has a switch of the given type.
Definition: libinput.h:393
uint64_t libinput_event_touch_get_time_usec(struct libinput_event_touch *event)
Definition: libinput.h:298
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-event...
int libinput_device_config_left_handed_get(struct libinput_device *device)
Get the current left-handed configuration of the device.
A keyboard event representing a key press/release.
Definition: libinput.h:116
An adaptive acceleration profile.
Definition: libinput.h:5233
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)
unsigned int libinput_tablet_pad_mode_group_get_index(struct libinput_tablet_pad_mode_group *group)
The returned number is the same index as passed to libinput_device_tablet_pad_get_mode_group().
enum libinput_tablet_pad_strip_axis_source libinput_event_tablet_pad_get_strip_source(struct libinput_event_tablet_pad *event)
Returns the source of the interaction with the strip.
enum libinput_config_status libinput_device_config_scroll_set_button_lock(struct libinput_device *device, enum libinput_config_scroll_button_lock_state state)
Set the scroll button lock.
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:6133
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.