From 402bf1269c59db4b3a78077ab095a84181181808 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 28 Jul 2022 20:31:28 +0200 Subject: Remove dependency on libevdev (mostly complete) + minor fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- libgamepad_drain_events.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 libgamepad_drain_events.c (limited to 'libgamepad_drain_events.c') diff --git a/libgamepad_drain_events.c b/libgamepad_drain_events.c new file mode 100644 index 0000000..b68ecad --- /dev/null +++ b/libgamepad_drain_events.c @@ -0,0 +1,18 @@ +/* See LICENSE file for copyright and license details. */ +#include "common.h" + + +int +libgamepad_drain_events(struct libgamepad_device *device) +{ + if (libgamepad_drain__(device)) + return -1; + device->internals->ev_queued = 0; + + if (device->auto_sync) { + return libgamepad_generate_sync_events(device); + } else { + device->internals->require_sync = 0; + return 0; + } +} -- cgit v1.2.3-70-g09d2