pico-sdl
Loading...
Searching...
No Matches
event_timeout.c
// file: event_timeout.c
#include <pico.h>
int main() {
SDL_Event event;
printf("Waiting for an event for the next 2 seconds...\n");
int happened = pico_input_event_timeout(&event, 0, 5000);
if (happened) {
printf("Event detected! Type: %d\n", event.type);
}
else {
printf("No event detected in those 2 seconds\n");
}
return 0;
}
void pico_init(int on)
Initializes and terminates pico.
int pico_input_event_timeout(Pico_Event *evt, int type, int timeout)
Stops the program until an event occurs or a timeout is reached.