# memberdef

refid: gaf14b21301bac9d79c20e890172873b96
name: libevdev_uinput_create_from_device
definition: int libevdev_uinput_create_from_device
type: int
argsstring: (const struct libevdev *dev, int uinput_fd, struct libevdev_uinput **uinput_dev)
briefdescription: Create a uinput device based on the given libevdev device.
detaileddescription:
 The uinput device
will be an exact copy of the libevdev device, minus the bits that uinput doesn't
allow to be set.

If uinput_fd is @ref LIBEVDEV_UINPUT_OPEN_MANAGED, libevdev_uinput_create_from_device()
will open @c /dev/uinput in read/write mode and manage the file descriptor.
Otherwise, uinput_fd must be opened by the caller and opened with the
appropriate permissions.

The device's lifetime is tied to the uinput file descriptor, closing it will
destroy the uinput device. You should call libevdev_uinput_destroy() before
closing the file descriptor to free allocated resources.
A file descriptor can only create one uinput device at a time; the second device
will fail with -EINVAL.

You don't need to keep the file descriptor variable around,
libevdev_uinput_get_fd() will return it when needed.

@note Due to limitations in the uinput kernel module, REP_DELAY and
REP_PERIOD will default to the kernel defaults, not to the ones set in the
source device.

@param dev The device to duplicate
@param uinput_fd @ref LIBEVDEV_UINPUT_OPEN_MANAGED or a file descriptor to @c /dev/uinput,
@param[out] uinput_dev The newly created libevdev device.

@return 0 on success or a negative errno on failure. On failure, the value of
uinput_dev is unmodified.

@see libevdev_uinput_destroy


refid: ga9dfa58a84eb4c6b97107dcf3fa621329
name: libevdev_uinput_destroy
definition: void libevdev_uinput_destroy
type: void
argsstring: (struct libevdev_uinput *uinput_dev)
briefdescription: Destroy a previously created uinput device and free associated memory.
detaileddescription:
If the device was opened with @ref LIBEVDEV_UINPUT_OPEN_MANAGED,
libevdev_uinput_destroy() also closes the file descriptor. Otherwise, the
fd is left as-is and must be closed by the caller.

@param uinput_dev A previously created uinput device.


refid: ga9cd7fb14a96d4cc14d3dffdcead84c5d
name: libevdev_uinput_get_fd
definition: int libevdev_uinput_get_fd
type: int
argsstring: (const struct libevdev_uinput *uinput_dev)
briefdescription: Return the file descriptor used to create this uinput device.
detaileddescription:
 This is the
fd pointing to <strong>/dev/uinput</strong>. This file descriptor may be used to write
events that are emitted by the uinput device.
Closing this file descriptor will destroy the uinput device, you should
call libevdev_uinput_destroy() first to free allocated resources.

@param uinput_dev A previously created uinput device.

@return The file descriptor used to create this device


refid: gaacca93061fce57cec0ce3c52e443a427
name: libevdev_uinput_get_syspath
definition: const char* libevdev_uinput_get_syspath
type: const char *
argsstring: (struct libevdev_uinput *uinput_dev)
briefdescription: Return the syspath representing this uinput device.
detaileddescription:
 If the UI_GET_SYSNAME
ioctl not available, libevdev makes an educated guess.
The UI_GET_SYSNAME ioctl is available since Linux 3.15.

@note This function may return NULL if UI_GET_SYSNAME is not available.
In that case, libevdev uses ctime and the device name to guess devices.
To avoid false positives, wait at least wait at least 1.5s between
creating devices that have the same name.
@param uinput_dev A previously created uinput device.
@return The syspath for this device, including the preceding /sys

@see libevdev_uinput_get_devnode


refid: ga4c595bcda748b08561e2819fe9b7c2d2
name: libevdev_uinput_get_devnode
definition: const char* libevdev_uinput_get_devnode
type: const char *
argsstring: (struct libevdev_uinput *uinput_dev)
briefdescription: Return the device node representing this uinput device.
detaileddescription:
This relies on libevdev_uinput_get_syspath() to provide a valid syspath.
See libevdev_uinput_get_syspath() for more details.

@note This function may return NULL. libevdev may have to guess the
syspath and the device node. See libevdev_uinput_get_syspath() for details.
@param uinput_dev A previously created uinput device.
@return The device node for this device, in the form of /dev/input/eventN

@see libevdev_uinput_get_syspath


refid: ga4c3c2f5fcd315a28a067f53b9f855fe7
name: libevdev_uinput_write_event
definition: int libevdev_uinput_write_event
type: int
argsstring: (const struct libevdev_uinput *uinput_dev, unsigned int type, unsigned int code, int value)
briefdescription: Post an event through the uinput device.
detaileddescription:
 It is the caller's responsibility
that any event sequence is terminated with an EV_SYN/SYN_REPORT/0 event.
Otherwise, listeners on the device node will not see the events until the
next EV_SYN event is posted.

@param uinput_dev A previously created uinput device.
@param type Event type (EV_ABS, EV_REL, etc.)
@param code Event code (ABS_X, REL_Y, etc.)
@param value The event value
@return 0 on success or a negative errno on error


refid: gaba39113f61c7fa4860ad7b4fdd2dfc6b
name: libevdev_log_func_t
type: void(*
briefdescription: Logging function called by library-internal logging.
definition:
typedef 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)

argsstring:
)(enum libevdev_log_priority priority, void *data, const char *file, int line, const char *func, const char *format, va_list args)

detaileddescription:
This function is expected to treat its input like printf would.

@param priority Log priority of this message
@param data User-supplied data pointer (see libevdev_set_log_function())
@param file libevdev source code file generating this message
@param line libevdev source code line generating this message
@param func libevdev source code function generating this message
@param format printf-style format string
@param args List of arguments

@see libevdev_set_log_function


refid: ga51080dc4fb8197595ba0af69de192f6d
name: libevdev_device_log_func_t
type: void(*
briefdescription: Logging function called by library-internal logging for a specific libevdev context.
definition:
typedef 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)

argsstring:
)(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)

detaileddescription:
 This function is expected to treat its input like
printf would.

@param dev The evdev device
@param priority Log priority of this message
@param data User-supplied data pointer (see libevdev_set_log_function())
@param file libevdev source code file generating this message
@param line libevdev source code line generating this message
@param func libevdev source code function generating this message
@param format printf-style format string
@param args List of arguments

@see libevdev_set_log_function
@since 1.3


refid: ga332c8ee260b4ef864345abe5d04e820c
name: libevdev_new
definition: struct libevdev* libevdev_new
type: struct libevdev *
argsstring: (void)
briefdescription: Initialize a new libevdev device.
detaileddescription:
 This function only allocates the
required memory and initializes the struct to sane default values.
To actually hook up the device to a kernel device, use
libevdev_set_fd().

Memory allocated through libevdev_new() must be released by the
caller with libevdev_free().

@see libevdev_set_fd
@see libevdev_free


refid: ga89bb5bce1c23e293293484b05b12aaf4
name: libevdev_new_from_fd
definition: int libevdev_new_from_fd
type: int
argsstring: (int fd, struct libevdev **dev)
briefdescription: Initialize a new libevdev device from the given fd.
detaileddescription:
This is a shortcut for

@code 
int err;
struct libevdev *dev = libevdev_new();
err = libevdev_set_fd(dev, fd);
@endcode

@param fd A file descriptor to the device in O_RDWR or O_RDONLY mode.
@param[out] dev The newly initialized evdev device.

@return On success, 0 is returned and dev is set to the newly
allocated struct. On failure, a negative errno is returned and the value
of dev is undefined.

@see libevdev_free


refid: gacd9fe760d15be25fc99ce469034bd78c
name: libevdev_free
definition: void libevdev_free
type: void
argsstring: (struct libevdev *dev)
briefdescription: Clean up and free the libevdev struct.
detaileddescription:
 After completion, the <code>struct
libevdev</code> is invalid and must not be used.

Note that calling libevdev_free() does not close the file descriptor
currently asssociated with this instance.

@param dev The evdev device

@note This function may be called before libevdev_set_fd().


refid: gaa60be86b83b3a6c82d8e536ba89ff955
name: libevdev_set_log_function
definition: void libevdev_set_log_function
type: void
argsstring: (libevdev_log_func_t logfunc, void *data)
briefdescription: Set a printf-style logging handler for library-internal logging.
detaileddescription:
 The default
logging function is to stdout.

@note The global log handler is only called if no context-specific log
handler has been set with libevdev_set_device_log_function().

@param logfunc The logging function for this device. If NULL, the current
logging function is unset and no logging is performed.
@param data User-specific data passed to the log handler.

@note This function may be called before libevdev_set_fd().

\xrefitem deprecated 1.


refid: gaf6b6842a9ed98b61d0abb421e853fd89
name: libevdev_set_log_priority
definition: void libevdev_set_log_priority
type: void
argsstring: (enum libevdev_log_priority priority)
briefdescription: Define the minimum level to be printed to the log handler.
detaileddescription:
Messages higher than this level are printed, others are discarded. This
is a global setting and applies to any future logging messages.

@param priority Minimum priority to be printed to the log.

\xrefitem deprecated 2.


refid: ga1da07493a798595cf85c127490b98ee8
name: libevdev_get_log_priority
definition: enum libevdev_log_priority libevdev_get_log_priority
type: enum libevdev_log_priority
argsstring: (void)
briefdescription: Return the current log priority level.
detaileddescription:
 Messages higher than this level
are printed, others are discarded. This is a global setting.

@return the current log level

\xrefitem deprecated 3.


refid: ga2830ff0aa391d8d1111682d3e762091b
name: libevdev_set_device_log_function
definition: void libevdev_set_device_log_function
type: void
briefdescription: Set a printf-style logging handler for library-internal logging for this device context.
argsstring:
(struct libevdev *dev, libevdev_device_log_func_t logfunc, enum libevdev_log_priority priority, void *data)

detaileddescription:
 The default logging function is NULL, i.e. the global log
handler is invoked. If a context-specific log handler is set, the global
log handler is not invoked for this device.

@note This log function applies for this device context only, even if
another context exists for the same fd.

@param dev The evdev device
@param logfunc The logging function for this device. If NULL, the current
logging function is unset and logging falls back to the global log
handler, if any.
@param priority Minimum priority to be printed to the log.
@param data User-specific data passed to the log handler.

@note This function may be called before libevdev_set_fd().
@since 1.3


refid: ga5d434af74fee20f273db568e2cbbd13f
name: libevdev_grab
definition: int libevdev_grab
type: int
argsstring: (struct libevdev *dev, enum libevdev_grab_mode grab)
briefdescription: Grab or ungrab the device through a kernel EVIOCGRAB.
detaileddescription:
 This prevents other
clients (including kernel-internal ones such as rfkill) from receiving
events from this device.

This is generally a bad idea. Don't do this.

Grabbing an already grabbed device, or ungrabbing an ungrabbed device is
a noop and always succeeds.

@param dev The evdev device, already initialized with libevdev_set_fd()
@param grab If true, grab the device. Otherwise ungrab the device.

@return 0 if the device was successfully grabbed or ungrabbed, or a
negative errno in case of failure.


refid: ga6658ac490d68c307ff8b8d1536c12b44
name: libevdev_set_fd
definition: int libevdev_set_fd
type: int
argsstring: (struct libevdev *dev, int fd)
briefdescription: Set the fd for this struct and initialize internal data.
detaileddescription:
The fd must be in O_RDONLY or O_RDWR mode.

This function may only be called once per device. If the device changed and
you need to re-read a device, use libevdev_free() and libevdev_new(). If
you need to change the fd after closing and re-opening the same device, use
libevdev_change_fd().

A caller should ensure that any events currently pending on the fd are
drained before the file descriptor is passed to libevdev for
initialization. Due to how the kernel's ioctl handling works, the initial
device state will reflect the current device state <em>after</em> applying all
events currently pending on the fd. Thus, if the fd is not drained, the
state visible to the caller will be inconsistent with the events
immediately available on the device. This does not affect state-less
events like EV_REL.

Unless otherwise specified, libevdev function behavior is undefined until
a successful call to libevdev_set_fd().

@param dev The evdev device
@param fd The file descriptor for the device

@return 0 on success, or a negative errno on failure

@see libevdev_change_fd
@see libevdev_new
@see libevdev_free


refid: gac71c9cca4c572ed1b1a8c233be70a17c
name: libevdev_change_fd
definition: int libevdev_change_fd
type: int
argsstring: (struct libevdev *dev, int fd)
briefdescription: Change the fd for this device, without re-reading the actual device.
detaileddescription:
 If the fd
changes after initializing the device, for example after a VT-switch in the
X.org X server, this function updates the internal fd to the newly opened.
No check is made that new fd points to the same device. If the device has
changed, libevdev's behavior is undefined.

libevdev does not sync itself after changing the fd and keeps the current
device state. Use libevdev_next_event with the
@ref LIBEVDEV_READ_FLAG_FORCE_SYNC flag to force a re-sync.

The example code below illustrates how to force a re-sync of the
library-internal state. Note that this code doesn't handle the events in
the caller, it merely forces an update of the internal library state.
@code 
    struct input_event ev;
    libevdev_change_fd(dev, new_fd);
    libevdev_next_event(dev, LIBEVDEV_READ_FLAG_FORCE_SYNC, &ev);
    while (libevdev_next_event(dev, LIBEVDEV_READ_FLAG_SYNC, &ev) == LIBEVDEV_READ_STATUS_SYNC)
                            ; // noop
@endcode

The fd may be open in O_RDONLY or O_RDWR.

It is an error to call this function before calling libevdev_set_fd().

@param dev The evdev device, already initialized with libevdev_set_fd()
@param fd The new fd

@return 0 on success, or -1 on failure.

@see libevdev_set_fd


refid: gab9bfc800859ac3aa63f41d58ec4b616c
name: libevdev_get_fd
definition: int libevdev_get_fd
type: int
argsstring: (const struct libevdev *dev)
detaileddescription:
@param dev The evdev device

@return The previously set fd, or -1 if none had been set previously.
@note This function may be called before libevdev_set_fd().


refid: gabb96c864e836c0b98788f4ab771c3a76
name: libevdev_next_event
definition: int libevdev_next_event
type: int
argsstring: (struct libevdev *dev, unsigned int flags, struct input_event *ev)
briefdescription: Get the next event from the device.
detaileddescription:
 This function operates in two different
modes: normal mode or sync mode.

In normal mode (when flags has @ref LIBEVDEV_READ_FLAG_NORMAL set), this
function returns @ref LIBEVDEV_READ_STATUS_SUCCESS and returns the event
in the argument @p ev. If no events are available at this
time, it returns -EAGAIN and ev is undefined.

If the current event is an EV_SYN SYN_DROPPED event, this function returns
@ref LIBEVDEV_READ_STATUS_SYNC and ev is set to the EV_SYN event.
The caller should now call this function with the
@ref LIBEVDEV_READ_FLAG_SYNC flag set, to get the set of events that make up the
device state delta. This function returns @ref LIBEVDEV_READ_STATUS_SYNC for
each event part of that delta, until it returns -EAGAIN once all events
have been synced. For more details on what libevdev does to sync after a
SYN_DROPPED event, see @ref syn_dropped.

If a device needs to be synced by the caller but the caller does not call
with the @ref LIBEVDEV_READ_FLAG_SYNC flag set, all events from the diff are
dropped after libevdev updates its internal state and event processing
continues as normal. Note that the current slot and the state of touch
points may have updated during the SYN_DROPPED event, it is strongly
recommended that a caller ignoring all sync events calls
libevdev_get_current_slot() and checks the ABS_MT_TRACKING_ID values for
all slots.

If a device has changed state without events being enqueued in libevdev,
e.g. after changing the file descriptor, use the @ref
LIBEVDEV_READ_FLAG_FORCE_SYNC flag. This triggers an internal sync of the
device and libevdev_next_event() returns @ref LIBEVDEV_READ_STATUS_SYNC.
Any state changes are available as events as described above. If
@ref LIBEVDEV_READ_FLAG_FORCE_SYNC is set, the value of ev is undefined.

@param dev The evdev device, already initialized with libevdev_set_fd()
@param flags Set of flags to determine behaviour. If @ref LIBEVDEV_READ_FLAG_NORMAL
is set, the next event is read in normal mode. If @ref LIBEVDEV_READ_FLAG_SYNC is
set, the next event is read in sync mode.
@param ev On success, set to the current event.
@return On failure, a negative errno is returned.
@retval LIBEVDEV_READ_STATUS_SUCCESS One or more events were read of the
device and ev points to the next event in the queue
@retval -EAGAIN No events are currently available on the device
@retval LIBEVDEV_READ_STATUS_SYNC A SYN_DROPPED event was received, or a
synced event was returned and ev points to the SYN_DROPPED event

@note This function is signal-safe.


refid: gae18fbfb59064c9c4b9d5db2d8cb23784
name: libevdev_has_event_pending
definition: int libevdev_has_event_pending
type: int
argsstring: (struct libevdev *dev)
briefdescription: Check if there are events waiting for us.
detaileddescription:
 This function does not read an
event off the fd and may not access the fd at all. If there are events
queued internally this function will return non-zero. If the internal
queue is empty, this function will poll the file descriptor for data.

This is a convenience function for simple processes, most complex programs
are expected to use select(2) or poll(2) on the file descriptor. The kernel
guarantees that if data is available, it is a multiple of sizeof(struct
input_event), and thus calling libevdev_next_event() when select(2) or
poll(2) return is safe. You do not need libevdev_has_event_pending() if
you're using select(2) or poll(2).

@param dev The evdev device, already initialized with libevdev_set_fd()
@return On failure, a negative errno is returned.
@retval 0 No event is currently available
@retval 1 One or more events are available on the fd

@note This function is signal-safe.


refid: gaed0328c67b7a78422636d9fe09a73f12
name: libevdev_get_name
definition: const char* libevdev_get_name
type: const char *
argsstring: (const struct libevdev *dev)
briefdescription: Retrieve the device's name, either as set by the caller or as read from the kernel.
detaileddescription:
 The string returned is valid until libevdev_free() or until
libevdev_set_name(), whichever comes earlier.

@param dev The evdev device, already initialized with libevdev_set_fd()

@return The device name as read off the kernel device. The name is never
NULL but it may be the empty string.

@note This function is signal-safe.


refid: gae5dcdb7678cdc9be4ab1989725b4ed32
name: libevdev_set_name
definition: void libevdev_set_name
type: void
argsstring: (struct libevdev *dev, const char *name)
briefdescription: Change the device's name as returned by libevdev_get_name().
detaileddescription:
 This
function destroys the string previously returned by libevdev_get_name(),
a caller must take care that no references are kept.

@param dev The evdev device
@param name The new, non-NULL, name to assign to this device.

@note This function may be called before libevdev_set_fd(). A call to
libevdev_set_fd() will overwrite any previously set value.


refid: ga5df483b0b24d7b96ea1181808fab851d
name: libevdev_get_phys
definition: const char* libevdev_get_phys
type: const char *
argsstring: (const struct libevdev *dev)
briefdescription: Retrieve the device's physical location, either as set by the caller or as read from the kernel.
detaileddescription:
 The string returned is valid until
libevdev_free() or until libevdev_set_phys(), whichever comes earlier.

Virtual devices such as uinput devices have no phys location.

@param dev The evdev device, already initialized with libevdev_set_fd()

@return The physical location of this device, or NULL if there is none

@note This function is signal safe.


refid: gacd57c8d6ace8e0b1417809a9c1c67af3
name: libevdev_set_phys
definition: void libevdev_set_phys
type: void
argsstring: (struct libevdev *dev, const char *phys)
briefdescription: Change the device's physical location as returned by libevdev_get_phys().
detaileddescription:
This function destroys the string previously returned by
libevdev_get_phys(), a caller must take care that no references are kept.

@param dev The evdev device
@param phys The new phys to assign to this device.

@note This function may be called before libevdev_set_fd(). A call to
libevdev_set_fd() will overwrite any previously set value.


refid: ga6d9f7d44bff8828ead3d251177035ca4
name: libevdev_get_uniq
definition: const char* libevdev_get_uniq
type: const char *
argsstring: (const struct libevdev *dev)
briefdescription: Retrieve the device's unique identifier, either as set by the caller or as read from the kernel.
detaileddescription:
 The string returned is valid until
libevdev_free() or until libevdev_set_uniq(), whichever comes earlier.

@param dev The evdev device, already initialized with libevdev_set_fd()

@return The unique identifier for this device, or NULL if there is none

@note This function is signal safe.


refid: ga4e4fd2627744fd5811c50c7403f27ad7
name: libevdev_set_uniq
definition: void libevdev_set_uniq
type: void
argsstring: (struct libevdev *dev, const char *uniq)
briefdescription: Change the device's unique identifier as returned by libevdev_get_uniq().
detaileddescription:
This function destroys the string previously returned by
libevdev_get_uniq(), a caller must take care that no references are kept.

@param dev The evdev device
@param uniq The new uniq to assign to this device.

@note This function may be called before libevdev_set_fd(). A call to
libevdev_set_fd() will overwrite any previously set value.


refid: ga1dc66cfef646878d58be72f8902a6bac
name: libevdev_get_id_product
definition: int libevdev_get_id_product
type: int
argsstring: (const struct libevdev *dev)
detaileddescription:
@param dev The evdev device, already initialized with libevdev_set_fd()

@return The device's product ID

@note This function is signal-safe.


refid: ga62fbdaac056ab5c3db154a9eeaf33799
name: libevdev_set_id_product
definition: void libevdev_set_id_product
type: void
argsstring: (struct libevdev *dev, int product_id)
detaileddescription:
@param dev The evdev device
@param product_id The product ID to assign to this device

@note This function may be called before libevdev_set_fd(). A call to
libevdev_set_fd() will overwrite any previously set value.


refid: ga08891c3285da5b8d26769c9a34f063f3
name: libevdev_get_id_vendor
definition: int libevdev_get_id_vendor
type: int
argsstring: (const struct libevdev *dev)
detaileddescription:
@param dev The evdev device, already initialized with libevdev_set_fd()

@return The device's vendor ID

@note This function is signal-safe.


refid: ga8ce28051ebbb73de1d04d782f4d0d6fe
name: libevdev_set_id_vendor
definition: void libevdev_set_id_vendor
type: void
argsstring: (struct libevdev *dev, int vendor_id)
detaileddescription:
@param dev The evdev device
@param vendor_id The vendor ID to assign to this device

@note This function may be called before libevdev_set_fd(). A call to
libevdev_set_fd() will overwrite any previously set value.


refid: ga9bf55d416401642bad0c435735682308
name: libevdev_get_id_bustype
definition: int libevdev_get_id_bustype
type: int
argsstring: (const struct libevdev *dev)
detaileddescription:
@param dev The evdev device, already initialized with libevdev_set_fd()

@return The device's bus type

@note This function is signal-safe.


refid: gaf99139c728ba1bd4b37ede612780b6b0
name: libevdev_set_id_bustype
definition: void libevdev_set_id_bustype
type: void
argsstring: (struct libevdev *dev, int bustype)
detaileddescription:
@param dev The evdev device
@param bustype The bustype to assign to this device

@note This function may be called before libevdev_set_fd(). A call to
libevdev_set_fd() will overwrite any previously set value.


refid: ga75a07d0c96dfe09d2194c104c429d0ae
name: libevdev_get_id_version
definition: int libevdev_get_id_version
type: int
argsstring: (const struct libevdev *dev)
detaileddescription:
@param dev The evdev device, already initialized with libevdev_set_fd()

@return The device's firmware version

@note This function is signal-safe.


refid: gaee1d2db88b191ec21d5bf22dd4fe3055
name: libevdev_set_id_version
definition: void libevdev_set_id_version
type: void
argsstring: (struct libevdev *dev, int version)
detaileddescription:
@param dev The evdev device
@param version The version to assign to this device

@note This function may be called before libevdev_set_fd(). A call to
libevdev_set_fd() will overwrite any previously set value.


refid: ga31e9e7a99215a03bcdc339b53e1be2fa
name: libevdev_get_driver_version
definition: int libevdev_get_driver_version
type: int
argsstring: (const struct libevdev *dev)
detaileddescription:
@param dev The evdev device, already initialized with libevdev_set_fd()

@return The driver version for this device

@note This function is signal-safe.


refid: ga36d529ea53f4522004bc7d16c051464b
name: libevdev_has_property
definition: int libevdev_has_property
type: int
argsstring: (const struct libevdev *dev, unsigned int prop)
detaileddescription:
@param dev The evdev device, already initialized with libevdev_set_fd()
@param prop The input property to query for, one of INPUT_PROP_...

@return 1 if the device provides this input property, or 0 otherwise.

@note This function is signal-safe


refid: gafc552080520c9d886452b05f3a1d75b6
name: libevdev_enable_property
definition: int libevdev_enable_property
type: int
argsstring: (struct libevdev *dev, unsigned int prop)
detaileddescription:
@param dev The evdev device
@param prop The input property to enable, one of INPUT_PROP_...

@return 0 on success or -1 on failure

@note This function may be called before libevdev_set_fd(). A call to
libevdev_set_fd() will overwrite any previously set value.


refid: ga398bef155fa4a0cfb832de30723ebd14
name: libevdev_has_event_type
definition: int libevdev_has_event_type
type: int
argsstring: (const struct libevdev *dev, unsigned int type)
detaileddescription:
@param dev The evdev device, already initialized with libevdev_set_fd()
@param type The event type to query for, one of EV_SYN, EV_REL, etc.

@return 1 if the device supports this event type, or 0 otherwise.

@note This function is signal-safe.


refid: gab2ab9dad417f33daa79fa0c3d682df0b
name: libevdev_has_event_code
definition: int libevdev_has_event_code
type: int
argsstring: (const struct libevdev *dev, unsigned int type, unsigned int code)
detaileddescription:
@param dev The evdev device, already initialized with libevdev_set_fd()
@param type The event type for the code to query (EV_SYN, EV_REL, etc.)
@param code The event code to query for, one of ABS_X, REL_X, etc.

@return 1 if the device supports this event type and code, or 0 otherwise.

@note This function is signal-safe.


refid: ga482ce989a3f62f7e67e4ea7ad534189e
name: libevdev_get_abs_minimum
definition: int libevdev_get_abs_minimum
type: int
argsstring: (const struct libevdev *dev, unsigned int code)
briefdescription: Get the minimum axis value for the given axis, as advertised by the kernel.
detaileddescription:
@param dev The evdev device, already initialized with libevdev_set_fd()
@param code The EV_ABS event code to query for, one of ABS_X, ABS_Y, etc.

@return axis minimum for the given axis or 0 if the axis is invalid

@note This function is signal-safe.


refid: ga97a3411ae85f1f3b5c5eb1d5351b11ca
name: libevdev_get_abs_maximum
definition: int libevdev_get_abs_maximum
type: int
argsstring: (const struct libevdev *dev, unsigned int code)
briefdescription: Get the maximum axis value for the given axis, as advertised by the kernel.
detaileddescription:
@param dev The evdev device, already initialized with libevdev_set_fd()
@param code The EV_ABS event code to query for, one of ABS_X, ABS_Y, etc.

@return axis maximum for the given axis or 0 if the axis is invalid

@note This function is signal-safe.


refid: ga1a3dfeb3bb2db0b4323c836c7ab10f1a
name: libevdev_get_abs_fuzz
definition: int libevdev_get_abs_fuzz
type: int
argsstring: (const struct libevdev *dev, unsigned int code)
briefdescription: Get the axis fuzz for the given axis, as advertised by the kernel.
detaileddescription:
@param dev The evdev device, already initialized with libevdev_set_fd()
@param code The EV_ABS event code to query for, one of ABS_X, ABS_Y, etc.

@return axis fuzz for the given axis or 0 if the axis is invalid

@note This function is signal-safe.


refid: ga6b3f7ebae2324524dc41384acd724b92
name: libevdev_get_abs_flat
definition: int libevdev_get_abs_flat
type: int
argsstring: (const struct libevdev *dev, unsigned int code)
briefdescription: Get the axis flat for the given axis, as advertised by the kernel.
detaileddescription:
@param dev The evdev device, already initialized with libevdev_set_fd()
@param code The EV_ABS event code to query for, one of ABS_X, ABS_Y, etc.

@return axis flat for the given axis or 0 if the axis is invalid

@note This function is signal-safe.


refid: ga75751e637a845201b6d1c419ecfa6ba4
name: libevdev_get_abs_resolution
definition: int libevdev_get_abs_resolution
type: int
argsstring: (const struct libevdev *dev, unsigned int code)
briefdescription: Get the axis resolution for the given axis, as advertised by the kernel.
detaileddescription:
@param dev The evdev device, already initialized with libevdev_set_fd()
@param code The EV_ABS event code to query for, one of ABS_X, ABS_Y, etc.

@return axis resolution for the given axis or 0 if the axis is invalid

@note This function is signal-safe.


refid: ga6d8e2caf87fa536fad979346671838d7
name: libevdev_get_abs_info
definition: const struct input_absinfo* libevdev_get_abs_info
type: const struct input_absinfo *
argsstring: (const struct libevdev *dev, unsigned int code)
briefdescription: Get the axis info for the given axis, as advertised by the kernel.
detaileddescription:
@param dev The evdev device, already initialized with libevdev_set_fd()
@param code The EV_ABS event code to query for, one of ABS_X, ABS_Y, etc.

@return The input_absinfo for the given code, or NULL if the device does
not support this event code.

@note This function is signal-safe.


refid: ga6259f4c6bdba950329ff9cd48c2ef8a3
name: libevdev_get_event_value
definition: int libevdev_get_event_value
type: int
argsstring: (const struct libevdev *dev, unsigned int type, unsigned int code)
briefdescription: Behaviour of this function is undefined if the device does not provide the event.
detaileddescription:
If the device supports ABS_MT_SLOT, the value returned for any ABS_MT_*
event code is the value of the currently active slot. You should use
libevdev_get_slot_value() instead.

@param dev The evdev device, already initialized with libevdev_set_fd()
@param type The event type for the code to query (EV_SYN, EV_REL, etc.)
@param code The event code to query for, one of ABS_X, REL_X, etc.

@return The current value of the event.

@note This function is signal-safe.
@note The value for ABS_MT_ events is undefined, use
libevdev_get_slot_value() instead

@see libevdev_get_slot_value


refid: ga79e82ee2a95cb08adb4172aabe0c7184
name: libevdev_set_event_value
definition: int libevdev_set_event_value
type: int
argsstring: (struct libevdev *dev, unsigned int type, unsigned int code, int value)
briefdescription: Set the value for a given event type and code.
detaileddescription:
 This only makes sense for
some event types, e.g. setting the value for EV_REL is pointless.

This is a local modification only affecting only this representation of
this device. A future call to libevdev_get_event_value() will return this
value, unless the value was overwritten by an event.

If the device supports ABS_MT_SLOT, the value set for any ABS_MT_*
event code is the value of the currently active slot. You should use
libevdev_set_slot_value() instead.

If the device supports ABS_MT_SLOT and the type is EV_ABS and the code is
ABS_MT_SLOT, the value must be a positive number less then the number of
slots on the device. Otherwise, libevdev_set_event_value() returns -1.

@param dev The evdev device, already initialized with libevdev_set_fd()
@param type The event type for the code to query (EV_SYN, EV_REL, etc.)
@param code The event code to set the value for, one of ABS_X, LED_NUML, etc.
@param value The new value to set

@return 0 on success, or -1 on failure.
@retval -1 the device does not have the event type or code enabled, or the code is outside the
allowed limits for the given type, or the type cannot be set, or the
value is not permitted for the given code.

@see libevdev_set_slot_value
@see libevdev_get_event_value


refid: ga0a7be80d769294bf9758adf79c3c7147
name: libevdev_fetch_event_value
definition: int libevdev_fetch_event_value
type: int
argsstring: (const struct libevdev *dev, unsigned int type, unsigned int code, int *value)
briefdescription: Fetch the current value of the event type.
detaileddescription:
 This is a shortcut for

@code 
  if (libevdev_has_event_type(dev, t) && libevdev_has_event_code(dev, t, c))
       val = libevdev_get_event_value(dev, t, c);
@endcode

@param dev The evdev device, already initialized with libevdev_set_fd()
@param type The event type for the code to query (EV_SYN, EV_REL, etc.)
@param code The event code to query for, one of ABS_X, REL_X, etc.
@param[out] value The current value of this axis returned.

@return If the device supports this event type and code, the return value is
non-zero and value is set to the current value of this axis. Otherwise,
0 is returned and value is unmodified.

@note This function is signal-safe.
@note The value for ABS_MT_ events is undefined, use
libevdev_fetch_slot_value() instead

@see libevdev_fetch_slot_value


refid: ga8c6303391cb4f90b2d46763cf4eb8bc8
name: libevdev_get_slot_value
definition: int libevdev_get_slot_value
type: int
argsstring: (const struct libevdev *dev, unsigned int slot, unsigned int code)
briefdescription: Return the current value of the code for the given slot.
detaileddescription:
The return value is undefined for a slot exceeding the available slots on
the device, for a code that is not in the permitted ABS_MT range or for a
device that does not have slots.

@param dev The evdev device, already initialized with libevdev_set_fd()
@param slot The numerical slot number, must be smaller than the total number
of slots on this device
@param code The event code to query for, one of ABS_MT_POSITION_X, etc.

@note This function is signal-safe.
@note The value for events other than ABS_MT_ is undefined, use
libevdev_fetch_value() instead

@see libevdev_get_event_value


refid: ga0c61f4919b03b0850529a50c37a20333
name: libevdev_set_slot_value
definition: int libevdev_set_slot_value
type: int
argsstring: (struct libevdev *dev, unsigned int slot, unsigned int code, int value)
briefdescription: Set the value for a given code for the given slot.
detaileddescription:
This is a local modification only affecting only this representation of
this device. A future call to libevdev_get_slot_value() will return this
value, unless the value was overwritten by an event.

This function does not set event values for axes outside the ABS_MT range,
use libevdev_set_event_value() instead.

@param dev The evdev device, already initialized with libevdev_set_fd()
@param slot The numerical slot number, must be smaller than the total number
of slots on this device
@param code The event code to set the value for, one of ABS_MT_POSITION_X, etc.
@param value The new value to set

@return 0 on success, or -1 on failure.
@retval -1 the device does not have the event code enabled, or the code is
outside the allowed limits for multitouch events, or the slot number is outside
the limits for this device, or the device does not support multitouch events.

@see libevdev_set_event_value
@see libevdev_get_slot_value


refid: gaca19dca5aa8f0ea3b210f3fc670384ec
name: libevdev_fetch_slot_value
definition: int libevdev_fetch_slot_value
type: int
argsstring: (const struct libevdev *dev, unsigned int slot, unsigned int code, int *value)
briefdescription: Fetch the current value of the code for the given slot.
detaileddescription:
 This is a shortcut for

@code 
  if (libevdev_has_event_type(dev, EV_ABS) &&
      libevdev_has_event_code(dev, EV_ABS, c) &&
      slot < device->number_of_slots)
      val = libevdev_get_slot_value(dev, slot, c);
@endcode

@param dev The evdev device, already initialized with libevdev_set_fd()
@param slot The numerical slot number, must be smaller than the total number
of slots on this * device
@param[out] value The current value of this axis returned.

@param code The event code to query for, one of ABS_MT_POSITION_X, etc.
@return If the device supports this event code, the return value is
non-zero and value is set to the current value of this axis. Otherwise, or
if the event code is not an ABS_MT_* event code, 0 is returned and value
is unmodified.

@note This function is signal-safe.


refid: gaf272526f0a59d2f61ef7389046cd4088
name: libevdev_get_num_slots
definition: int libevdev_get_num_slots
type: int
argsstring: (const struct libevdev *dev)
briefdescription: Get the number of slots supported by this device.
detaileddescription:
@param dev The evdev device, already initialized with libevdev_set_fd()

@return The number of slots supported, or -1 if the device does not provide
any slots

@note A device may provide ABS_MT_SLOT but a total number of 0 slots. Hence
the return value of -1 for "device does not provide slots at all"


refid: gad22e2420be668b56ef486cde2e98c5dd
name: libevdev_get_current_slot
definition: int libevdev_get_current_slot
type: int
argsstring: (const struct libevdev *dev)
briefdescription: Get the currently active slot.
detaileddescription:
 This may differ from the value
an ioctl may return at this time as events may have been read off the fd
since changing the slot value but those events are still in the buffer
waiting to be processed. The returned value is the value a caller would
see if it were to process events manually one-by-one.

@param dev The evdev device, already initialized with libevdev_set_fd()

@return the currently active slot (logically)

@note This function is signal-safe.


refid: ga32507e7798fd7cd863cc730f0d84aac9
name: libevdev_set_abs_minimum
definition: void libevdev_set_abs_minimum
type: void
argsstring: (struct libevdev *dev, unsigned int code, int min)
briefdescription: Change the minimum for the given EV_ABS event code, if the code exists.
detaileddescription:
This function has no effect if libevdev_has_event_code() returns false for
this code.

@param dev The evdev device, already initialized with libevdev_set_fd()
@param code One of ABS_X, ABS_Y, ...
@param min The new minimum for this axis


refid: ga2fd1825d45ca1f08d4a929a73cea5216
name: libevdev_set_abs_maximum
definition: void libevdev_set_abs_maximum
type: void
argsstring: (struct libevdev *dev, unsigned int code, int max)
briefdescription: Change the maximum for the given EV_ABS event code, if the code exists.
detaileddescription:
This function has no effect if libevdev_has_event_code() returns false for
this code.

@param dev The evdev device, already initialized with libevdev_set_fd()
@param code One of ABS_X, ABS_Y, ...
@param max The new maxium for this axis


refid: ga9f4f81faf4a1702c9076cc839b5746ab
name: libevdev_set_abs_fuzz
definition: void libevdev_set_abs_fuzz
type: void
argsstring: (struct libevdev *dev, unsigned int code, int fuzz)
briefdescription: Change the fuzz for the given EV_ABS event code, if the code exists.
detaileddescription:
This function has no effect if libevdev_has_event_code() returns false for
this code.

@param dev The evdev device, already initialized with libevdev_set_fd()
@param code One of ABS_X, ABS_Y, ...
@param fuzz The new fuzz for this axis


refid: gad9b091c31c1df99ecc681358aab4a039
name: libevdev_set_abs_flat
definition: void libevdev_set_abs_flat
type: void
argsstring: (struct libevdev *dev, unsigned int code, int flat)
briefdescription: Change the flat for the given EV_ABS event code, if the code exists.
detaileddescription:
This function has no effect if libevdev_has_event_code() returns false for
this code.

@param dev The evdev device, already initialized with libevdev_set_fd()
@param code One of ABS_X, ABS_Y, ...
@param flat The new flat for this axis


refid: ga71da3214377e99a98c125fbce67d4059
name: libevdev_set_abs_resolution
definition: void libevdev_set_abs_resolution
type: void
argsstring: (struct libevdev *dev, unsigned int code, int resolution)
briefdescription: Change the resolution for the given EV_ABS event code, if the code exists.
detaileddescription:
This function has no effect if libevdev_has_event_code() returns false for
this code.

@param dev The evdev device, already initialized with libevdev_set_fd()
@param code One of ABS_X, ABS_Y, ...
@param resolution The new axis resolution


refid: gafc7a4f5308e2dbf55f875630b8dca049
name: libevdev_set_abs_info
definition: void libevdev_set_abs_info
type: void
argsstring: (struct libevdev *dev, unsigned int code, const struct input_absinfo *abs)
briefdescription: Change the abs info for the given EV_ABS event code, if the code exists.
detaileddescription:
This function has no effect if libevdev_has_event_code() returns false for
this code.

@param dev The evdev device, already initialized with libevdev_set_fd()
@param code One of ABS_X, ABS_Y, ...
@param abs The new absolute axis data (min, max, fuzz, flat, resolution)


refid: ga59ef78b1557f9543d0060ab25b0167ca
name: libevdev_enable_event_type
definition: int libevdev_enable_event_type
type: int
argsstring: (struct libevdev *dev, unsigned int type)
briefdescription: Forcibly enable an event type on this device, even if the underlying device does not support it.
detaileddescription:
 While this cannot make the device actually
report such events, it will now return true for libevdev_has_event_type().

This is a local modification only affecting only this representation of
this device.

@param dev The evdev device, already initialized with libevdev_set_fd()
@param type The event type to enable (EV_ABS, EV_KEY, ...)

@return 0 on success or -1 otherwise

@see libevdev_has_event_type


refid: gabbacb53b66882b5335055c0fd1f40d9a
name: libevdev_disable_event_type
definition: int libevdev_disable_event_type
type: int
argsstring: (struct libevdev *dev, unsigned int type)
briefdescription: Forcibly disable an event type on this device, even if the underlying device provides it.
detaileddescription:
 This effectively mutes the respective set of
events. libevdev will filter any events matching this type and none will
reach the caller. libevdev_has_event_type() will return false for this
type.

In most cases, a caller likely only wants to disable a single code, not
the whole type. Use libevdev_disable_event_code() for that.

Disabling EV_SYN will not work. Don't shoot yourself in the foot.
It hurts.

This is a local modification only affecting only this representation of
this device.

@param dev The evdev device, already initialized with libevdev_set_fd()
@param type The event type to disable (EV_ABS, EV_KEY, ...)

@return 0 on success or -1 otherwise

@see libevdev_has_event_type
@see libevdev_disable_event_type


refid: ga51cfda33fd526549046399aadd764fca
name: libevdev_enable_event_code
definition: int libevdev_enable_event_code
type: int
argsstring: (struct libevdev *dev, unsigned int type, unsigned int code, const void *data)
briefdescription: Forcibly enable an event code on this device, even if the underlying device does not support it.
detaileddescription:
 While this cannot make the device actually
report such events, it will now return true for libevdev_has_event_code().

The last argument depends on the type and code:
- If type is EV_ABS, data must be a pointer to a struct input_absinfo
  containing the data for this axis.
- If type is EV_REP, data must be a pointer to a int containing the data
  for this axis
- For all other types, the argument must be NULL.

This function calls libevdev_enable_event_type() if necessary.

This is a local modification only affecting only this representation of
this device.

If this function is called with a type of EV_ABS and EV_REP on a device
that already has the given event code enabled, the values in data
overwrite the previous values.

@param dev The evdev device, already initialized with libevdev_set_fd()
@param type The event type to enable (EV_ABS, EV_KEY, ...)
@param code The event code to enable (ABS_X, REL_X, etc.)
@param data If type is EV_ABS, data points to a struct input_absinfo. If type is EV_REP, data
points to an integer. Otherwise, data must be NULL.

@return 0 on success or -1 otherwise

@see libevdev_enable_event_type


refid: ga6199a7c8144f54e092e913c2d2df16de
name: libevdev_disable_event_code
definition: int libevdev_disable_event_code
type: int
argsstring: (struct libevdev *dev, unsigned int type, unsigned int code)
briefdescription: Forcibly disable an event code on this device, even if the underlying device provides it.
detaileddescription:
 This effectively mutes the respective set of
events. libevdev will filter any events matching this type and code and
none will reach the caller. libevdev_has_event_code() will return false for
this code.

Disabling all event codes for a given type will not disable the event
type. Use libevdev_disable_event_type() for that.

This is a local modification only affecting only this representation of
this device.

Disabling codes of type EV_SYN will not work. Don't shoot yourself in the
foot. It hurts.

@param dev The evdev device, already initialized with libevdev_set_fd()
@param type The event type to disable (EV_ABS, EV_KEY, ...)
@param code The event code to disable (ABS_X, REL_X, etc.)

@return 0 on success or -1 otherwise

@see libevdev_has_event_code
@see libevdev_disable_event_type


refid: ga41c0321b93349d0ddd1f1c007ccf7de9
name: libevdev_kernel_set_abs_info
definition: int libevdev_kernel_set_abs_info
type: int
argsstring: (struct libevdev *dev, unsigned int code, const struct input_absinfo *abs)
briefdescription: Set the device's EV_ABS axis to the value defined in the abs parameter.
detaileddescription:
 This will be written to the kernel.

@param dev The evdev device, already initialized with libevdev_set_fd()
@param code The EV_ABS event code to modify, one of ABS_X, ABS_Y, etc.
@param abs Axis info to set the kernel axis to

@return 0 on success, or a negative errno on failure

@see libevdev_enable_event_code


refid: gaa7d13aeac3c40e16f296467780e67c01
name: libevdev_kernel_set_led_value
definition: int libevdev_kernel_set_led_value
type: int
argsstring: (struct libevdev *dev, unsigned int code, enum libevdev_led_value value)
briefdescription: Turn an LED on or off.
detaileddescription:
 Convenience function, if you need to modify multiple
LEDs simultaneously, use libevdev_kernel_set_led_values() instead.

@note enabling an LED requires write permissions on the device's file descriptor.

@param dev The evdev device, already initialized with libevdev_set_fd()
@param code The EV_LED event code to modify, one of LED_NUML, LED_CAPSL, ...
@param value Specifies whether to turn the LED on or off
@return 0 on success, or a negative errno on failure


refid: ga93a19fa6e5be57903aff7c4a60af2a00
name: libevdev_kernel_set_led_values
definition: int libevdev_kernel_set_led_values
type: int
argsstring: (struct libevdev *dev,...)
briefdescription: Turn multiple LEDs on or off simultaneously.
detaileddescription:
 This function expects a pair
of LED codes and values to set them to, terminated by a -1. For example, to
switch the NumLock LED on but the CapsLock LED off, use:

@code 
    libevdev_kernel_set_led_values(dev, LED_NUML, LIBEVDEV_LED_ON,
                                        LED_CAPSL, LIBEVDEV_LED_OFF,
                                        -1);
@endcode

If any LED code or value is invalid, this function returns -EINVAL and no
LEDs are modified.

@note enabling an LED requires write permissions on the device's file descriptor.

@param dev The evdev device, already initialized with libevdev_set_fd()
@param ... A pair of LED_* event codes and libevdev_led_value_t, followed by
-1 to terminate the list.
@return 0 on success, or a negative errno on failure


refid: ga2925b6fbf8c7991ff2164424b840b82d
name: libevdev_set_clock_id
definition: int libevdev_set_clock_id
type: int
argsstring: (struct libevdev *dev, int clockid)
briefdescription: Set the clock ID to be used for timestamps.
detaileddescription:
 Further events from this device
will report an event time based on the given clock.

This is a modification only affecting this representation of
this device.

@param dev The evdev device, already initialized with libevdev_set_fd()
@param clockid The clock to use for future events. Permitted values
are CLOCK_MONOTONIC and CLOCK_REALTIME (the default).
@return 0 on success, or a negative errno on failure


refid: gab8b6b80740e028261300b8952b61a596
name: libevdev_event_is_type
definition: int libevdev_event_is_type
type: int
argsstring: (const struct input_event *ev, unsigned int type)
briefdescription: Helper function to check if an event is of a specific type.
detaileddescription:
 This is
virtually the same as:
@verbatim
 ev->type == type
@endverbatim

with the exception that some sanity checks are performed to ensure type
is valid.

@note The ranges for types are compiled into libevdev. If the kernel
changes the max value, libevdev will not automatically pick these up.

@param ev The input event to check
@param type Input event type to compare the event against (EV_REL, EV_ABS,
etc.)

@return 1 if the event type matches the given type, 0 otherwise (or if
type is invalid)


refid: ga37766a6a498fef3294d589abcce688bb
name: libevdev_event_is_code
definition: int libevdev_event_is_code
type: int
argsstring: (const struct input_event *ev, unsigned int type, unsigned int code)
briefdescription: Helper function to check if an event is of a specific type and code.
detaileddescription:
 This
is virtually the same as:
@verbatim
 ev->type == type && ev->code == code
@endverbatim

with the exception that some sanity checks are performed to ensure type and
code are valid.

@note The ranges for types and codes are compiled into libevdev. If the kernel
changes the max value, libevdev will not automatically pick these up.

@param ev The input event to check
@param type Input event type to compare the event against (EV_REL, EV_ABS,
etc.)
@param code Input event code to compare the event against (ABS_X, REL_X,
etc.)

@return 1 if the event type matches the given type and code, 0 otherwise
(or if type/code are invalid)


refid: gac99720fd926bf288764f9a81bf37ed09
name: libevdev_event_type_get_name
definition: const char* libevdev_event_type_get_name
type: const char *
argsstring: (unsigned int type)
detaileddescription:
@param type The event type to return the name for.

@return The name of the given event type (e.g. EV_ABS) or NULL for an
invalid type

@note The list of names is compiled into libevdev. If the kernel adds new
defines for new event types, libevdev will not automatically pick these up.


refid: gab407b3c2caaae502859c28460cad17bb
name: libevdev_event_code_get_name
definition: const char* libevdev_event_code_get_name
type: const char *
argsstring: (unsigned int type, unsigned int code)
detaileddescription:
@param type The event type for the code to query (EV_SYN, EV_REL, etc.)
@param code The event code to return the name for (e.g. ABS_X)

@return The name of the given event code (e.g. ABS_X) or NULL for an
invalid type or code

@note The list of names is compiled into libevdev. If the kernel adds new
defines for new event codes, libevdev will not automatically pick these up.


refid: gacc12bdb7b912070ac9c375428f2c9892
name: libevdev_property_get_name
definition: const char* libevdev_property_get_name
type: const char *
argsstring: (unsigned int prop)
detaileddescription:
@param prop The input prop to return the name for (e.g. INPUT_PROP_BUTTONPAD)

@return The name of the given input prop (e.g. INPUT_PROP_BUTTONPAD) or NULL for an
invalid property

@note The list of names is compiled into libevdev. If the kernel adds new
defines for new properties libevdev will not automatically pick these up.
@note On older kernels input properties may not be defined and
libevdev_property_get_name() will always return NULL


refid: gabfad87ea78d034631cf3e5322ac383a1
name: libevdev_event_type_get_max
definition: int libevdev_event_type_get_max
type: int
argsstring: (unsigned int type)
detaileddescription:
@param type The event type to return the maximum for (EV_ABS, EV_REL, etc.). No max is defined for
EV_SYN.

@return The max value defined for the given event type, e.g. ABS_MAX for a type of EV_ABS, or -1
for an invalid type.

@note The max value is compiled into libevdev. If the kernel changes the
max value, libevdev will not automatically pick these up.


refid: ga61ce3bf1e66bd172e583b86a11fc41f1
name: libevdev_event_type_from_name
definition: int libevdev_event_type_from_name
type: int
argsstring: (const char *name)
briefdescription: Look up an event-type by its name.
detaileddescription:
 Event-types start with "EV_" followed by
the name (eg., "EV_ABS"). The "EV_" prefix must be included in the name. It
returns the constant assigned to the event-type or -1 if not found.

@param name A non-NULL string describing an input-event type ("EV_KEY",
"EV_ABS", ...), zero-terminated.

@return The given type constant for the passed name or -1 if not found.

@note EV_MAX is also recognized.


refid: ga4ee03d650200bb04a23233570667fa84
name: libevdev_event_type_from_name_n
definition: int libevdev_event_type_from_name_n
type: int
argsstring: (const char *name, size_t len)
briefdescription: Look up an event-type by its name.
detaileddescription:
 Event-types start with "EV_" followed by
the name (eg., "EV_ABS"). The "EV_" prefix must be included in the name. It
returns the constant assigned to the event-type or -1 if not found.

@param name A non-NULL string describing an input-event type ("EV_KEY",
"EV_ABS", ...).
@param len The length of the passed string excluding any terminating 0
character.

@return The given type constant for the passed name or -1 if not found.

@note EV_MAX is also recognized.


refid: ga6620301a67f467489e4a7f93afe81621
name: libevdev_event_code_from_name
definition: int libevdev_event_code_from_name
type: int
argsstring: (unsigned int type, const char *name)
briefdescription: Look up an event code by its type and name.
detaileddescription:
 Event codes start with a fixed
prefix followed by their name (eg., "ABS_X"). The prefix must be included in
the name. It returns the constant assigned to the event code or -1 if not
found.

You have to pass the event type where to look for the name. For instance, to
resolve "ABS_X" you need to pass EV_ABS as type and "ABS_X" as string.
Supported event codes are codes starting with SYN_, KEY_, BTN_, REL_, ABS_,
MSC_, SND_, SW_, LED_, REP_, FF_.

@param type The event type (EV_* constant) where to look for the name.
@param name A non-NULL string describing an input-event code ("KEY_A",
"ABS_X", "BTN_Y", ...), zero-terminated.

@return The given code constant for the passed name or -1 if not found.


refid: ga17a760a9eea9dc25011f39e1d5c282a0
name: libevdev_event_code_from_name_n
definition: int libevdev_event_code_from_name_n
type: int
argsstring: (unsigned int type, const char *name, size_t len)
briefdescription: Look up an event code by its type and name.
detaileddescription:
 Event codes start with a fixed
prefix followed by their name (eg., "ABS_X"). The prefix must be included in
the name. It returns the constant assigned to the event code or -1 if not
found.

You have to pass the event type where to look for the name. For instance, to
resolve "ABS_X" you need to pass EV_ABS as type and "ABS_X" as string.
Supported event codes are codes starting with SYN_, KEY_, BTN_, REL_, ABS_,
MSC_, SND_, SW_, LED_, REP_, FF_.

@param type The event type (EV_* constant) where to look for the name.
@param name A non-NULL string describing an input-event code ("KEY_A",
"ABS_X", "BTN_Y", ...).
@param len The length of the string in @p name excluding any terminating 0
character.

@return The given code constant for the name or -1 if not found.


refid: ga6f4418c98aa475a2fc34d58a197f7edd
name: libevdev_property_from_name
definition: int libevdev_property_from_name
type: int
argsstring: (const char *name)
briefdescription: Look up an input property by its name.
detaileddescription:
 Properties start with the fixed
prefix "INPUT_PROP_" followed by their name (eg., "INPUT_PROP_POINTER").
The prefix must be included in the name. It returns the constant assigned
to the property or -1 if not found.

@param name A non-NULL string describing an input property

@return The given code constant for the name or -1 if not found.


refid: gaaa0bc4c7d0d2aedc84c7dcffee9ce29b
name: libevdev_property_from_name_n
definition: int libevdev_property_from_name_n
type: int
argsstring: (const char *name, size_t len)
briefdescription: Look up an input property by its name.
detaileddescription:
 Properties start with the fixed
prefix "INPUT_PROP_" followed by their name (eg., "INPUT_PROP_POINTER").
The prefix must be included in the name. It returns the constant assigned
to the property or -1 if not found.

@param name A non-NULL string describing an input property
@param len The length of the string in @p name excluding any terminating 0
character.

@return The given code constant for the name or -1 if not found.


refid: gaf12fa199bb9497b38358d72e7505d770
name: libevdev_get_repeat
definition: int libevdev_get_repeat
type: int
argsstring: (const struct libevdev *dev, int *delay, int *period)
briefdescription: Get the repeat delay and repeat period values for this device.
detaileddescription:
 This
function is a convenience function only, EV_REP is supported by
libevdev_get_event_value().

@param dev The evdev device, already initialized with libevdev_set_fd()
@param delay If not null, set to the repeat delay value
@param period If not null, set to the repeat period value

@return 0 on success, -1 if this device does not have repeat settings.

@note This function is signal-safe

@see libevdev_get_event_value


