libevdev
1.4.4
A wrapper library for evdev devices
|
Abstraction functions to handle device capabilities, specificially device properties such as the name of the device and the bits representing the events suppported by this device. More...
Functions | |
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. More... | |
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. More... | |
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. More... | |
int | libevdev_get_id_product (const struct libevdev *dev) |
int | libevdev_get_id_vendor (const struct libevdev *dev) |
int | libevdev_get_id_bustype (const struct libevdev *dev) |
int | libevdev_get_id_version (const struct libevdev *dev) |
int | libevdev_get_driver_version (const struct libevdev *dev) |
int | libevdev_has_property (const struct libevdev *dev, unsigned int prop) |
int | libevdev_has_event_type (const struct libevdev *dev, unsigned int type) |
int | libevdev_has_event_code (const struct libevdev *dev, unsigned int type, unsigned int code) |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
int | libevdev_get_repeat (const struct libevdev *dev, int *delay, int *period) |
Get the repeat delay and repeat period values for this device. More... | |
Abstraction functions to handle device capabilities, specificially device properties such as the name of the device and the bits representing the events suppported by this device.
The logical state returned may lag behind the physical state of the device. libevdev queries the device state on libevdev_set_fd() and then relies on the caller to parse events through libevdev_next_event(). If a caller does not use libevdev_next_event(), libevdev will not update the internal state of the device and thus returns outdated values.
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.
This is a shortcut for
dev | The evdev device, already initialized with libevdev_set_fd() | |
type | The event type for the code to query (EV_SYN, EV_REL, etc.) | |
code | The event code to query for, one of ABS_X, REL_X, etc. | |
[out] | value | The current value of this axis returned. |
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.
dev | The evdev device, already initialized with libevdev_set_fd() |
code | The EV_ABS event code to query for, one of ABS_X, ABS_Y, etc. |
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.
dev | The evdev device, already initialized with libevdev_set_fd() |
code | The EV_ABS event code to query for, one of ABS_X, ABS_Y, etc. |
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.
dev | The evdev device, already initialized with libevdev_set_fd() |
code | The EV_ABS event code to query for, one of ABS_X, ABS_Y, etc. |
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.
dev | The evdev device, already initialized with libevdev_set_fd() |
code | The EV_ABS event code to query for, one of ABS_X, ABS_Y, etc. |
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.
dev | The evdev device, already initialized with libevdev_set_fd() |
code | The EV_ABS event code to query for, one of ABS_X, ABS_Y, etc. |
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.
dev | The evdev device, already initialized with libevdev_set_fd() |
code | The EV_ABS event code to query for, one of ABS_X, ABS_Y, etc. |
int libevdev_get_driver_version | ( | const struct libevdev * | dev | ) |
dev | The evdev device, already initialized with libevdev_set_fd() |
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.
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.
dev | The evdev device, already initialized with libevdev_set_fd() |
type | The event type for the code to query (EV_SYN, EV_REL, etc.) |
code | The event code to query for, one of ABS_X, REL_X, etc. |
int libevdev_get_id_bustype | ( | const struct libevdev * | dev | ) |
dev | The evdev device, already initialized with libevdev_set_fd() |
int libevdev_get_id_product | ( | const struct libevdev * | dev | ) |
dev | The evdev device, already initialized with libevdev_set_fd() |
int libevdev_get_id_vendor | ( | const struct libevdev * | dev | ) |
dev | The evdev device, already initialized with libevdev_set_fd() |
int libevdev_get_id_version | ( | const struct libevdev * | dev | ) |
dev | The evdev device, already initialized with libevdev_set_fd() |
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.
The string returned is valid until libevdev_free() or until libevdev_set_name(), whichever comes earlier.
dev | The evdev device, already initialized with libevdev_set_fd() |
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.
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.
dev | The evdev device, already initialized with libevdev_set_fd() |
int libevdev_get_repeat | ( | const struct libevdev * | dev, |
int * | delay, | ||
int * | period | ||
) |
Get the repeat delay and repeat period values for this device.
This function is a convenience function only, EV_REP is supported by libevdev_get_event_value().
dev | The evdev device, already initialized with libevdev_set_fd() |
delay | If not null, set to the repeat delay value |
period | If not null, set to the repeat period value |
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.
The string returned is valid until libevdev_free() or until libevdev_set_uniq(), whichever comes earlier.
dev | The evdev device, already initialized with libevdev_set_fd() |
int libevdev_has_event_code | ( | const struct libevdev * | dev, |
unsigned int | type, | ||
unsigned int | code | ||
) |
dev | The evdev device, already initialized with libevdev_set_fd() |
type | The event type for the code to query (EV_SYN, EV_REL, etc.) |
code | The event code to query for, one of ABS_X, REL_X, etc. |
int libevdev_has_event_type | ( | const struct libevdev * | dev, |
unsigned int | type | ||
) |
dev | The evdev device, already initialized with libevdev_set_fd() |
type | The event type to query for, one of EV_SYN, EV_REL, etc. |
int libevdev_has_property | ( | const struct libevdev * | dev, |
unsigned int | prop | ||
) |
dev | The evdev device, already initialized with libevdev_set_fd() |
prop | The input property to query for, one of INPUT_PROP_... |