mirror of
https://gitlab.freedesktop.org/libevdev/libevdev.git
synced 2025-12-21 10:50:06 +01:00
Slots are now definitely zero-indexed, see recent kernel patch
doc: specify that ABS_MT_SLOT must have a minimum of 0 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
960dc91844
commit
b10444f82f
2 changed files with 4 additions and 4 deletions
|
|
@ -243,7 +243,7 @@ libevdev_set_fd(struct libevdev* dev, int fd)
|
|||
|
||||
dev->abs_info[i] = abs_info;
|
||||
if (i == ABS_MT_SLOT) {
|
||||
dev->num_slots = abs_info.maximum + 1; /* FIXME: non-zero min? */
|
||||
dev->num_slots = abs_info.maximum + 1;
|
||||
dev->current_slot = abs_info.value;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -533,11 +533,11 @@ int libevdev_fetch_slot_value(const struct libevdev *dev, unsigned int slot, uns
|
|||
*
|
||||
* Get the number of slots supported by this device.
|
||||
*
|
||||
* Note that the slot offset may be non-zero, use libevdev_get_abs_min() or
|
||||
* libevdev_get_abs_info() to get the minimum slot number.
|
||||
*
|
||||
* @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"
|
||||
*/
|
||||
int libevdev_get_num_slots(const struct libevdev *dev);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue