libevdev/man/libevdev_get_event_value.txt

72 lines
2.5 KiB
Text
Raw Normal View History

libevdev_get_event_value(3)
===========================
NAME
----
libevdev_get_event_value, libevdev_fetch_event_value, libevdev_get_slot_value, libevdev_fetch_slot_value - retrieve the current value of an event type and code.
SYNOPSIS
--------
#include <libevdev/libevdev.h>
int libevdev_get_event_value(const struct libevdev *dev, unsigned int type, unsigned int code);
int libevdev_fetch_event_value(const struct libevdev *dev, unsigned int type, unsigned int code, int *value);
int libevdev_get_slot_value(const struct libevdev *dev, unsigned int slot, unsigned int code);
int libevdev_fetch_slot_value(const struct libevdev *dev, unsigned int slot, unsigned int code, int *value);
DESCRIPTION
-----------
*libevdev_get_event_value* returns the current value of the given event type
and code on this device. The caller must check if the event type and code
are available on this device with *libevdev_has_event_type(3)* and
*libevdev_has_event_code(3)*.
*libevdev_get_event_value* may not be used to check for the current value
of any ABS_MT_* axis if the device supports multitouchs slots. Use
*libevdev_get_slot_value* instead.
*libevev_get_slot_value* returns the current value of the given multitouch
slot. The caller must check if the device supports the multitouch slot
protocol with *libevdev_has_event_type(3)* and
*libevdev_has_event_code(3)*. The caller must ensure that the requested slot
value is within the allowed range (see *libevdev_get_num_slots(3)*).
*libevdev_fetch_event_value* and *libevdev_fetch_slot_value* are convenience
functions so callers can check if an axis or slot exists and fetch the value
in one function call.
PARAMETERS
----------
*dev*::
Pointer to the libevdev device.
*type*::
Specifies the event type to query.
*code*::
Specifies the event code to query.
*slot*::
Specifies the MT slot to query.
*value*::
Returns the current value of the event code or slot.
RETURN VALUE
------------
On success, *libevdev_get_event_value* and *libevdev_get_slot_value* returns
the current value of the axis and/or slot. If the device does not support
this axis or the slot is invalid, the return value is undefined.
On success, *libevdev_fetch_event_value* and *libevdev_fetch_slot_value*
return 1 and ''value'' is set to the current value of this axis, or slot,
respectively. If the device does not support this axis or the slot is
invalid, 0 is returned and ''value'' is left as-is.
SEE ALSO
--------
libevdev_has_event_type(3), libevdev_has_event_code(3), libevdev_get_num_slots(3)