aboutsummaryrefslogblamecommitdiffstats
path: root/libgamepad_drain_events.c
blob: b68ecad390e0a198dd359cb272396ebd069ac30d (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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;
	}
}