mirror of
https://gitlab.freedesktop.org/libevdev/libevdev.git
synced 2025-12-24 13:30:06 +01:00
Make sure EV_SYN is always set
Set the bit during device reset and make sure that if we're checking for the event type we always return true for EV_SYN. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
This commit is contained in:
parent
03c3e4f975
commit
521ba2300e
1 changed files with 2 additions and 1 deletions
|
|
@ -120,6 +120,7 @@ libevdev_reset(struct libevdev *dev)
|
|||
dev->current_slot = -1;
|
||||
dev->grabbed = LIBEVDEV_UNGRAB;
|
||||
dev->sync_state = SYNC_NONE;
|
||||
libevdev_enable_event_type(dev, EV_SYN);
|
||||
}
|
||||
|
||||
LIBEVDEV_EXPORT struct libevdev*
|
||||
|
|
@ -944,7 +945,7 @@ libevdev_enable_property(struct libevdev *dev, unsigned int prop)
|
|||
LIBEVDEV_EXPORT int
|
||||
libevdev_has_event_type(const struct libevdev *dev, unsigned int type)
|
||||
{
|
||||
return (type <= EV_MAX) && bit_is_set(dev->bits, type);
|
||||
return type == EV_SYN ||(type <= EV_MAX && bit_is_set(dev->bits, type));
|
||||
}
|
||||
|
||||
LIBEVDEV_EXPORT int
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue