libevdev
0.3
A wrapper library for evdev devices
|
Functions for querying multi-touch-related capabilities. More...
Functions | |
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. More... | |
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. More... | |
int | libevdev_get_num_slots (const struct libevdev *dev) |
Get the number of slots supported by this device. More... | |
int | libevdev_get_current_slot (const struct libevdev *dev) |
Get the currently active slot. More... | |
Functions for querying multi-touch-related capabilities.
MT devices following the kernel protocol B (using ABS_MT_SLOT) provide multiple touch points through so-called slots on the same axis. The slots are enumerated, a client reading from the device will first get an ABS_MT_SLOT event, then the values of axes changed in this slot. Multiple slots may be provided in before an EV_SYN event.
As with Querying device capabilities, the logical state of the device as seen by the library depends on the caller using libevdev_next_event().
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.
This is a shortcut for
dev | The evdev device, already initialized with libevdev_set_fd() | |
slot | The numerical slot number, must be smaller than the total number of slots on this * device | |
[out] | value | The current value of this axis returned. |
code | The event code to query for, one of ABS_MT_POSITION_X, etc. |
int libevdev_get_current_slot | ( | const struct libevdev * | dev | ) |
Get the currently active slot.
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.
dev | The evdev device, already initialized with libevdev_set_fd() |
int libevdev_get_num_slots | ( | const struct libevdev * | dev | ) |
Get the number of slots supported by this device.
dev | The evdev device, already initialized with libevdev_set_fd() |
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.
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.
dev | The evdev device, already initialized with libevdev_set_fd() |
slot | The numerical slot number, must be smaller than the total number of slots on this * device |
code | The event code to query for, one of ABS_MT_POSITION_X, etc. |