doc: eventloop

This commit is contained in:
Justin M. Keyes
2017-08-31 23:20:30 +02:00
parent b6b6e4a96f
commit 46fdacc5b5
3 changed files with 32 additions and 6 deletions

View File

@@ -49,11 +49,13 @@ getkey:
ui_flush();
// Call `os_inchar` directly to block for events or user input without
// consuming anything from `input_buffer`(os/input.c) or calling the
// mapping engine. If an event was put into the queue, we send K_EVENT
// directly.
// mapping engine.
(void)os_inchar(NULL, 0, -1, 0);
input_disable_events();
key = !multiqueue_empty(main_loop.events) ? K_EVENT : safe_vgetc();
// If an event was put into the queue, we send K_EVENT directly.
key = !multiqueue_empty(main_loop.events)
? K_EVENT
: safe_vgetc();
}
if (key == K_EVENT) {