aboutsummaryrefslogtreecommitdiffstats
path: root/libgamepad_drain_events.c
diff options
context:
space:
mode:
Diffstat (limited to 'libgamepad_drain_events.c')
-rw-r--r--libgamepad_drain_events.c18
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;
+ }
+}