Returns the event type of the next event pending in the queue. For systems
that have the device init state separate from the actual event procesing
(read: xorg drivers) we need to be able to peek at the next event type to
check for the end of any initialization events (seat/device added) and the
beginning of actual device input events.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
return event;
}
+LIBINPUT_EXPORT enum libinput_event_type
+libinput_next_event_type(struct libinput *libinput)
+{
+ struct libinput_event *event;
+
+ if (libinput->events_count == 0)
+ return LIBINPUT_EVENT_NONE;
+
+ event = libinput->events[libinput->events_out];
+ return event->type;
+}
+
LIBINPUT_EXPORT void *
libinput_get_user_data(struct libinput *libinput)
{
struct libinput_event *
libinput_get_event(struct libinput *libinput);
+/**
+ * @ingroup base
+ *
+ * Return the type of the next event in the internal queue. This function
+ * does not pop the event off the queue and the next call to
+ * libinput_get_event() returns that event.
+ *
+ * @param libinput A previously initialized libinput context
+ * @return The event type of the next available event or LIBINPUT_EVENT_NONE
+ * if no event is availble.
+ */
+enum libinput_event_type
+libinput_next_event_type(struct libinput *libinput);
+
/**
* @ingroup base
*