Loading...
Searching...
No Matches
libevdev.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: MIT */
2/*
3 * Copyright © 2013 Red Hat, Inc.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a copy
6 * of this software and associated documentation files (the "Software"), to
7 * deal in the Software without restriction, including without limitation the
8 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
9 * sell copies of the Software, and to permit persons to whom the Software is
10 * 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 THE
19 * 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 DEALINGS
22 * IN THE SOFTWARE.
23 *
24 */
25
26#ifndef LIBEVDEV_H
27#define LIBEVDEV_H
28
29#ifdef __cplusplus
30 extern "C" {
31#endif
32
33#include <linux/input.h>
34#include <stdarg.h>
35
36#define LIBEVDEV_ATTRIBUTE_PRINTF(_format, _args) __attribute__ ((format (printf, _format, _args)))
37
179
436
485
554
563
577
624
651
674
688
716
735
744
753
759 struct libevdev;
760
764 enum libevdev_read_flag {
765 LIBEVDEV_READ_FLAG_SYNC = 1,
766 LIBEVDEV_READ_FLAG_NORMAL = 2,
767 LIBEVDEV_READ_FLAG_FORCE_SYNC = 4,
769 LIBEVDEV_READ_FLAG_BLOCKING = 8
770};
771
786 struct libevdev* libevdev_new(void);
787
810 int libevdev_new_from_fd(int fd, struct libevdev **dev);
811
825 void libevdev_free(struct libevdev *dev);
826
830 enum libevdev_log_priority {
831 LIBEVDEV_LOG_ERROR = 10,
832 LIBEVDEV_LOG_INFO = 20,
833 LIBEVDEV_LOG_DEBUG = 30
834};
835
852 typedef void (*libevdev_log_func_t)(enum libevdev_log_priority priority,
853 void *data,
854 const char *file, int line,
855 const char *func,
856 const char *format, va_list args)
857 LIBEVDEV_ATTRIBUTE_PRINTF(6, 0);
858
877 void libevdev_set_log_function(libevdev_log_func_t logfunc, void *data);
878
891 void libevdev_set_log_priority(enum libevdev_log_priority priority);
892
904 enum libevdev_log_priority libevdev_get_log_priority(void);
905
925 typedef void (*libevdev_device_log_func_t)(const struct libevdev *dev,
926 enum libevdev_log_priority priority,
927 void *data,
928 const char *file, int line,
929 const char *func,
930 const char *format, va_list args)
931 LIBEVDEV_ATTRIBUTE_PRINTF(7, 0);
932
954 void libevdev_set_device_log_function(struct libevdev *dev,
955 libevdev_device_log_func_t logfunc,
956 enum libevdev_log_priority priority,
957 void *data);
958
962 enum libevdev_grab_mode {
963 LIBEVDEV_GRAB = 3,
964 LIBEVDEV_UNGRAB = 4
965};
966
989 int libevdev_grab(struct libevdev *dev, enum libevdev_grab_mode grab);
990
1023 int libevdev_set_fd(struct libevdev* dev, int fd);
1024
1063 int libevdev_change_fd(struct libevdev* dev, int fd);
1064
1073 int libevdev_get_fd(const struct libevdev* dev);
1074
1078 enum libevdev_read_status {
1085 LIBEVDEV_READ_STATUS_SUCCESS = 0,
1094 LIBEVDEV_READ_STATUS_SYNC = 1
1095};
1096
1147 int libevdev_next_event(struct libevdev *dev, unsigned int flags, struct input_event *ev);
1148
1171 int libevdev_has_event_pending(struct libevdev *dev);
1172
1187 const char* libevdev_get_name(const struct libevdev *dev);
1188
1202 void libevdev_set_name(struct libevdev *dev, const char *name);
1203
1219 const char * libevdev_get_phys(const struct libevdev *dev);
1220
1234 void libevdev_set_phys(struct libevdev *dev, const char *phys);
1235
1249 const char * libevdev_get_uniq(const struct libevdev *dev);
1250
1264 void libevdev_set_uniq(struct libevdev *dev, const char *uniq);
1265
1275 int libevdev_get_id_product(const struct libevdev *dev);
1276
1288 void libevdev_set_id_product(struct libevdev *dev, int product_id);
1289
1299 int libevdev_get_id_vendor(const struct libevdev *dev);
1300
1312 void libevdev_set_id_vendor(struct libevdev *dev, int vendor_id);
1313
1323 int libevdev_get_id_bustype(const struct libevdev *dev);
1324
1336 void libevdev_set_id_bustype(struct libevdev *dev, int bustype);
1337
1347 int libevdev_get_id_version(const struct libevdev *dev);
1348
1360 void libevdev_set_id_version(struct libevdev *dev, int version);
1361
1371 int libevdev_get_driver_version(const struct libevdev *dev);
1372
1383 int libevdev_has_property(const struct libevdev *dev, unsigned int prop);
1384
1396 int libevdev_enable_property(struct libevdev *dev, unsigned int prop);
1397
1406 int libevdev_disable_property(struct libevdev *dev, unsigned int prop);
1407
1418 int libevdev_has_event_type(const struct libevdev *dev, unsigned int type);
1419
1431 int libevdev_has_event_code(const struct libevdev *dev, unsigned int type, unsigned int code);
1432
1445 int libevdev_get_abs_minimum(const struct libevdev *dev, unsigned int code);
1446
1459 int libevdev_get_abs_maximum(const struct libevdev *dev, unsigned int code);
1460
1473 int libevdev_get_abs_fuzz(const struct libevdev *dev, unsigned int code);
1474
1487 int libevdev_get_abs_flat(const struct libevdev *dev, unsigned int code);
1488
1501 int libevdev_get_abs_resolution(const struct libevdev *dev, unsigned int code);
1502
1516 const struct input_absinfo* libevdev_get_abs_info(const struct libevdev *dev, unsigned int code);
1517
1539 int libevdev_get_event_value(const struct libevdev *dev, unsigned int type, unsigned int code);
1540
1575 int libevdev_set_event_value(struct libevdev *dev, unsigned int type, unsigned int code, int value);
1576
1602 int libevdev_fetch_event_value(const struct libevdev *dev, unsigned int type, unsigned int code, int *value);
1603
1624 int libevdev_get_slot_value(const struct libevdev *dev, unsigned int slot, unsigned int code);
1625
1654 int libevdev_set_slot_value(struct libevdev *dev, unsigned int slot, unsigned int code, int value);
1655
1681 int libevdev_fetch_slot_value(const struct libevdev *dev, unsigned int slot, unsigned int code, int *value);
1682
1696 int libevdev_get_num_slots(const struct libevdev *dev);
1697
1713 int libevdev_get_current_slot(const struct libevdev *dev);
1714
1726 void libevdev_set_abs_minimum(struct libevdev *dev, unsigned int code, int val);
1727
1739 void libevdev_set_abs_maximum(struct libevdev *dev, unsigned int code, int val);
1740
1752 void libevdev_set_abs_fuzz(struct libevdev *dev, unsigned int code, int val);
1753
1765 void libevdev_set_abs_flat(struct libevdev *dev, unsigned int code, int val);
1766
1778 void libevdev_set_abs_resolution(struct libevdev *dev, unsigned int code, int val);
1779
1791 void libevdev_set_abs_info(struct libevdev *dev, unsigned int code, const struct input_absinfo *abs);
1792
1810 int libevdev_enable_event_type(struct libevdev *dev, unsigned int type);
1811
1838 int libevdev_disable_event_type(struct libevdev *dev, unsigned int type);
1839
1873 int libevdev_enable_event_code(struct libevdev *dev, unsigned int type, unsigned int code, const void *data);
1874
1902 int libevdev_disable_event_code(struct libevdev *dev, unsigned int type, unsigned int code);
1903
1918 int libevdev_kernel_set_abs_info(struct libevdev *dev, unsigned int code, const struct input_absinfo *abs);
1919
1923 enum libevdev_led_value {
1924 LIBEVDEV_LED_ON = 3,
1925 LIBEVDEV_LED_OFF = 4
1926};
1927
1941 int libevdev_kernel_set_led_value(struct libevdev *dev, unsigned int code, enum libevdev_led_value value);
1942
1966 int libevdev_kernel_set_led_values(struct libevdev *dev, ...);
1967
1982 int libevdev_set_clock_id(struct libevdev *dev, int clockid);
1983
2005 int libevdev_event_is_type(const struct input_event *ev, unsigned int type);
2006
2030 int libevdev_event_is_code(const struct input_event *ev, unsigned int type, unsigned int code);
2031
2043 const char * libevdev_event_type_get_name(unsigned int type);
2056 const char * libevdev_event_code_get_name(unsigned int type, unsigned int code);
2057
2078 const char * libevdev_event_value_get_name(unsigned int type,
2079 unsigned int code,
2080 int value);
2094 const char* libevdev_property_get_name(unsigned int prop);
2095
2108 int libevdev_event_type_get_max(unsigned int type);
2109
2124 int libevdev_event_type_from_name(const char *name);
2125
2142 int libevdev_event_type_from_name_n(const char *name, size_t len);
2143
2163 int libevdev_event_code_from_name(unsigned int type, const char *name);
2164
2186 int libevdev_event_code_from_name_n(unsigned int type, const char *name,
2187 size_t len);
2188
2210 int libevdev_event_value_from_name(unsigned int type, unsigned int code,
2211 const char *name);
2212
2229 int
2230 libevdev_event_type_from_code_name(const char *name);
2231
2250 int
2251 libevdev_event_type_from_code_name_n(const char *name, size_t len);
2252
2269 int
2270 libevdev_event_code_from_code_name(const char *name);
2271
2290 int
2291 libevdev_event_code_from_code_name_n(const char *name, size_t len);
2292
2316 int libevdev_event_value_from_name_n(unsigned int type, unsigned int code,
2317 const char *name, size_t len);
2318
2331 int libevdev_property_from_name(const char *name);
2332
2347 int libevdev_property_from_name_n(const char *name, size_t len);
2348
2366 int libevdev_get_repeat(const struct libevdev *dev, int *delay, int *period);
2367
2368/********* DEPRECATED SECTION *********/
2369#if defined(__GNUC__) && __GNUC__ >= 4
2370#define LIBEVDEV_DEPRECATED __attribute__ ((deprecated))
2371#else
2372#define LIBEVDEV_DEPRECATED
2373#endif
2374
2375#ifdef __cplusplus
2376}
2377#endif
2378
2379#endif /* LIBEVDEV_H */
libevdev_get_id_vendor
int libevdev_get_id_vendor(const struct libevdev *dev)
libevdev_fetch_event_value
int libevdev_fetch_event_value(const struct libevdev *dev, unsigned int type, unsigned int code, int *value)
Fetch the current value of the event type.
libevdev_get_abs_fuzz
int libevdev_get_abs_fuzz(const struct libevdev *dev, unsigned int code)
Get the axis fuzz for the given axis, as advertised by the kernel.
libevdev_get_id_product
int libevdev_get_id_product(const struct libevdev *dev)
libevdev_get_driver_version
int libevdev_get_driver_version(const struct libevdev *dev)
libevdev_has_property
int libevdev_has_property(const struct libevdev *dev, unsigned int prop)
libevdev_has_event_type
int libevdev_has_event_type(const struct libevdev *dev, unsigned int type)
libevdev_get_phys
const char * libevdev_get_phys(const struct libevdev *dev)
Retrieve the device's physical location, either as set by the caller or as read from the kernel.
libevdev_get_uniq
const char * libevdev_get_uniq(const struct libevdev *dev)
Retrieve the device's unique identifier, either as set by the caller or as read from the kernel.
libevdev_get_abs_minimum
int libevdev_get_abs_minimum(const struct libevdev *dev, unsigned int code)
Get the minimum axis value for the given axis, as advertised by the kernel.
libevdev_get_event_value
int libevdev_get_event_value(const struct libevdev *dev, unsigned int type, unsigned int code)
Behaviour of this function is undefined if the device does not provide the event.
libevdev_get_abs_flat
int libevdev_get_abs_flat(const struct libevdev *dev, unsigned int code)
Get the axis flat for the given axis, as advertised by the kernel.
libevdev_get_abs_resolution
int libevdev_get_abs_resolution(const struct libevdev *dev, unsigned int code)
Get the axis resolution for the given axis, as advertised by the kernel.
libevdev_get_id_version
int libevdev_get_id_version(const struct libevdev *dev)
libevdev_get_name
const char * libevdev_get_name(const struct libevdev *dev)
Retrieve the device's name, either as set by the caller or as read from the kernel.
libevdev_get_abs_maximum
int libevdev_get_abs_maximum(const struct libevdev *dev, unsigned int code)
Get the maximum axis value for the given axis, as advertised by the kernel.
libevdev_get_id_bustype
int libevdev_get_id_bustype(const struct libevdev *dev)
libevdev_has_event_code
int libevdev_has_event_code(const struct libevdev *dev, unsigned int type, unsigned int code)
libevdev_get_abs_info
const struct input_absinfo * libevdev_get_abs_info(const struct libevdev *dev, unsigned int code)
Get the axis info for the given axis, as advertised by the kernel.
libevdev_get_repeat
int libevdev_get_repeat(const struct libevdev *dev, int *delay, int *period)
Get the repeat delay and repeat period values for this device.
libevdev_read_status
libevdev_read_status
Definition libevdev.h:1078
libevdev_read_flag
libevdev_read_flag
Definition libevdev.h:764
libevdev_next_event
int libevdev_next_event(struct libevdev *dev, unsigned int flags, struct input_event *ev)
Get the next event from the device.
libevdev_has_event_pending
int libevdev_has_event_pending(struct libevdev *dev)
Check if there are events waiting for us.
LIBEVDEV_READ_STATUS_SYNC
@ LIBEVDEV_READ_STATUS_SYNC
Depending on the libevdev_next_event() read flag:
Definition libevdev.h:1094
LIBEVDEV_READ_STATUS_SUCCESS
@ LIBEVDEV_READ_STATUS_SUCCESS
libevdev_next_event() has finished without an error and an event is available for processing.
Definition libevdev.h:1085
LIBEVDEV_READ_FLAG_BLOCKING
@ LIBEVDEV_READ_FLAG_BLOCKING
The fd is not in O_NONBLOCK and a read may block.
Definition libevdev.h:769
LIBEVDEV_READ_FLAG_SYNC
@ LIBEVDEV_READ_FLAG_SYNC
Process data in sync mode.
Definition libevdev.h:765
LIBEVDEV_READ_FLAG_FORCE_SYNC
@ LIBEVDEV_READ_FLAG_FORCE_SYNC
Pretend the next event is a SYN_DROPPED and require the caller to sync.
Definition libevdev.h:767
LIBEVDEV_READ_FLAG_NORMAL
@ LIBEVDEV_READ_FLAG_NORMAL
Process data in normal mode.
Definition libevdev.h:766
libevdev_grab
int libevdev_grab(struct libevdev *dev, enum libevdev_grab_mode grab)
Grab or ungrab the device through a kernel EVIOCGRAB.
libevdev_set_fd
int libevdev_set_fd(struct libevdev *dev, int fd)
Set the fd for this struct and initialize internal data.
libevdev_new_from_fd
int libevdev_new_from_fd(int fd, struct libevdev **dev)
Initialize a new libevdev device from the given fd.
libevdev_grab_mode
libevdev_grab_mode
Definition libevdev.h:962
libevdev_new
struct libevdev * libevdev_new(void)
Initialize a new libevdev device.
libevdev_get_fd
int libevdev_get_fd(const struct libevdev *dev)
libevdev_change_fd
int libevdev_change_fd(struct libevdev *dev, int fd)
Change the fd for this device, without re-reading the actual device.
libevdev_free
void libevdev_free(struct libevdev *dev)
Clean up and free the libevdev struct.
LIBEVDEV_UNGRAB
@ LIBEVDEV_UNGRAB
Ungrab the device if currently grabbed.
Definition libevdev.h:964
LIBEVDEV_GRAB
@ LIBEVDEV_GRAB
Grab the device if not currently grabbed.
Definition libevdev.h:963
libevdev_set_slot_value
int libevdev_set_slot_value(struct libevdev *dev, unsigned int slot, unsigned int code, int value)
Set the value for a given code for the given slot.
libevdev_set_abs_resolution
void libevdev_set_abs_resolution(struct libevdev *dev, unsigned int code, int val)
Change the resolution for the given EV_ABS event code, if the code exists.
libevdev_set_abs_maximum
void libevdev_set_abs_maximum(struct libevdev *dev, unsigned int code, int val)
Change the maximum for the given EV_ABS event code, if the code exists.
libevdev_set_clock_id
int libevdev_set_clock_id(struct libevdev *dev, int clockid)
Set the clock ID to be used for timestamps.
libevdev_kernel_set_abs_info
int libevdev_kernel_set_abs_info(struct libevdev *dev, unsigned int code, const struct input_absinfo *abs)
Set the device's EV_ABS axis to the value defined in the abs parameter.
libevdev_set_uniq
void libevdev_set_uniq(struct libevdev *dev, const char *uniq)
Change the device's unique identifier as returned by libevdev_get_uniq().
libevdev_enable_event_code
int libevdev_enable_event_code(struct libevdev *dev, unsigned int type, unsigned int code, const void *data)
Forcibly enable an event code on this device, even if the underlying device does not support it.
libevdev_enable_event_type
int libevdev_enable_event_type(struct libevdev *dev, unsigned int type)
Forcibly enable an event type on this device, even if the underlying device does not support it.
libevdev_disable_event_code
int libevdev_disable_event_code(struct libevdev *dev, unsigned int type, unsigned int code)
Forcibly disable an event code on this device, even if the underlying device provides it.
libevdev_set_id_product
void libevdev_set_id_product(struct libevdev *dev, int product_id)
libevdev_set_event_value
int libevdev_set_event_value(struct libevdev *dev, unsigned int type, unsigned int code, int value)
Set the value for a given event type and code.
libevdev_led_value
libevdev_led_value
Definition libevdev.h:1923
libevdev_set_id_vendor
void libevdev_set_id_vendor(struct libevdev *dev, int vendor_id)
libevdev_disable_property
int libevdev_disable_property(struct libevdev *dev, unsigned int prop)
libevdev_kernel_set_led_values
int libevdev_kernel_set_led_values(struct libevdev *dev,...)
Turn multiple LEDs on or off simultaneously.
libevdev_set_abs_fuzz
void libevdev_set_abs_fuzz(struct libevdev *dev, unsigned int code, int val)
Change the fuzz for the given EV_ABS event code, if the code exists.
libevdev_kernel_set_led_value
int libevdev_kernel_set_led_value(struct libevdev *dev, unsigned int code, enum libevdev_led_value value)
Turn an LED on or off.
libevdev_disable_event_type
int libevdev_disable_event_type(struct libevdev *dev, unsigned int type)
Forcibly disable an event type on this device, even if the underlying device provides it.
libevdev_set_abs_flat
void libevdev_set_abs_flat(struct libevdev *dev, unsigned int code, int val)
Change the flat for the given EV_ABS event code, if the code exists.
libevdev_set_abs_minimum
void libevdev_set_abs_minimum(struct libevdev *dev, unsigned int code, int val)
Change the minimum for the given EV_ABS event code, if the code exists.
libevdev_set_phys
void libevdev_set_phys(struct libevdev *dev, const char *phys)
Change the device's physical location as returned by libevdev_get_phys().
libevdev_set_name
void libevdev_set_name(struct libevdev *dev, const char *name)
Change the device's name as returned by libevdev_get_name().
libevdev_set_id_version
void libevdev_set_id_version(struct libevdev *dev, int version)
libevdev_set_id_bustype
void libevdev_set_id_bustype(struct libevdev *dev, int bustype)
libevdev_enable_property
int libevdev_enable_property(struct libevdev *dev, unsigned int prop)
libevdev_set_abs_info
void libevdev_set_abs_info(struct libevdev *dev, unsigned int code, const struct input_absinfo *abs)
Change the abs info for the given EV_ABS event code, if the code exists.
LIBEVDEV_LED_OFF
@ LIBEVDEV_LED_OFF
Turn the LED off.
Definition libevdev.h:1925
LIBEVDEV_LED_ON
@ LIBEVDEV_LED_ON
Turn the LED on.
Definition libevdev.h:1924
libevdev_log_priority
libevdev_log_priority
Definition libevdev.h:830
libevdev_get_log_priority
enum libevdev_log_priority libevdev_get_log_priority(void)
Return the current log priority level.
libevdev_set_device_log_function
void libevdev_set_device_log_function(struct libevdev *dev, libevdev_device_log_func_t logfunc, enum libevdev_log_priority priority, void *data)
Set a printf-style logging handler for library-internal logging for this device context.
libevdev_set_log_function
void libevdev_set_log_function(libevdev_log_func_t logfunc, void *data)
Set a printf-style logging handler for library-internal logging.
libevdev_device_log_func_t
void(* libevdev_device_log_func_t)(const struct libevdev *dev, enum libevdev_log_priority priority, void *data, const char *file, int line, const char *func, const char *format, va_list args)
Logging function called by library-internal logging for a specific libevdev context.
Definition libevdev.h:925
libevdev_log_func_t
void(* libevdev_log_func_t)(enum libevdev_log_priority priority, void *data, const char *file, int line, const char *func, const char *format, va_list args)
Logging function called by library-internal logging.
Definition libevdev.h:852
libevdev_set_log_priority
void libevdev_set_log_priority(enum libevdev_log_priority priority)
Define the minimum level to be printed to the log handler.
LIBEVDEV_LOG_ERROR
@ LIBEVDEV_LOG_ERROR
critical errors and application bugs
Definition libevdev.h:831
LIBEVDEV_LOG_INFO
@ LIBEVDEV_LOG_INFO
informational messages
Definition libevdev.h:832
LIBEVDEV_LOG_DEBUG
@ LIBEVDEV_LOG_DEBUG
debug information
Definition libevdev.h:833
libevdev_event_value_get_name
const char * libevdev_event_value_get_name(unsigned int type, unsigned int code, int value)
This function resolves the event value for a code.
libevdev_event_code_from_name_n
int libevdev_event_code_from_name_n(unsigned int type, const char *name, size_t len)
Look up an event code by its type and name.
libevdev_event_value_from_name
int libevdev_event_value_from_name(unsigned int type, unsigned int code, const char *name)
Look up an event value by its type, code and name.
libevdev_event_is_code
int libevdev_event_is_code(const struct input_event *ev, unsigned int type, unsigned int code)
Helper function to check if an event is of a specific type and code.
libevdev_event_type_get_name
const char * libevdev_event_type_get_name(unsigned int type)
libevdev_event_type_from_name_n
int libevdev_event_type_from_name_n(const char *name, size_t len)
Look up an event-type by its name.
libevdev_event_code_get_name
const char * libevdev_event_code_get_name(unsigned int type, unsigned int code)
libevdev_event_code_from_code_name_n
int libevdev_event_code_from_code_name_n(const char *name, size_t len)
Look up an event code by its name.
libevdev_event_type_from_name
int libevdev_event_type_from_name(const char *name)
Look up an event-type by its name.
libevdev_event_code_from_name
int libevdev_event_code_from_name(unsigned int type, const char *name)
Look up an event code by its type and name.
libevdev_property_from_name
int libevdev_property_from_name(const char *name)
Look up an input property by its name.
libevdev_property_get_name
const char * libevdev_property_get_name(unsigned int prop)
libevdev_property_from_name_n
int libevdev_property_from_name_n(const char *name, size_t len)
Look up an input property by its name.
libevdev_event_type_from_code_name_n
int libevdev_event_type_from_code_name_n(const char *name, size_t len)
Look up an event type for a event code name.
libevdev_event_is_type
int libevdev_event_is_type(const struct input_event *ev, unsigned int type)
Helper function to check if an event is of a specific type.
libevdev_event_code_from_code_name
int libevdev_event_code_from_code_name(const char *name)
Look up an event code by its name.
libevdev_event_type_get_max
int libevdev_event_type_get_max(unsigned int type)
libevdev_event_type_from_code_name
int libevdev_event_type_from_code_name(const char *name)
Look up an event type for a event code name.
libevdev_event_value_from_name_n
int libevdev_event_value_from_name_n(unsigned int type, unsigned int code, const char *name, size_t len)
Look up an event value by its type, code and name.
libevdev_get_slot_value
int libevdev_get_slot_value(const struct libevdev *dev, unsigned int slot, unsigned int code)
Return the current value of the code for the given slot.
libevdev_fetch_slot_value
int libevdev_fetch_slot_value(const struct libevdev *dev, unsigned int slot, unsigned int code, int *value)
Fetch the current value of the code for the given slot.
libevdev_get_current_slot
int libevdev_get_current_slot(const struct libevdev *dev)
Get the currently active slot.
libevdev_get_num_slots
int libevdev_get_num_slots(const struct libevdev *dev)
Get the number of slots supported by this device.
LIBEVDEV_ATTRIBUTE_PRINTF
#define LIBEVDEV_ATTRIBUTE_PRINTF(_format, _args)
Definition libevdev.h:36