diff options
author | Mattias Andrée <maandree@kth.se> | 2022-07-28 20:31:28 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2022-07-28 20:37:42 +0200 |
commit | 402bf1269c59db4b3a78077ab095a84181181808 (patch) | |
tree | b9f445318d9f1e09a5af77ac39b23dc8e50c7a52 /libgamepad_drain_events.c | |
parent | Minor code improvement (diff) | |
download | libgamepad-402bf1269c59db4b3a78077ab095a84181181808.tar.gz libgamepad-402bf1269c59db4b3a78077ab095a84181181808.tar.bz2 libgamepad-402bf1269c59db4b3a78077ab095a84181181808.tar.xz |
Remove dependency on libevdev (mostly complete) + minor fixes
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r-- | libgamepad_drain_events.c | 18 |
1 files changed, 18 insertions, 0 deletions
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; + } +} |