Files
Upsilon/ion/src/shared/events_stdin.cpp
Émilie Feral 38a1048bc1 [ion] repare blackbox
Change-Id: I1229ad45e29db6dac5c296b87acd5663c5564cea
2017-04-14 15:00:38 +02:00

17 lines
398 B
C++

#include <ion/events.h>
#include <stdio.h>
#include <stdlib.h>
/* Use this implementation of Ion::Events::getEvent to simulate pre-recorded key
* presses. It streams event recorded to a file and played back from standard
* input. */
Ion::Events::Event Ion::Events::getEvent(int * timeout) {
int c = getchar();
if (c == EOF) {
exit(0);
} else {
return Ion::Events::Event(c);
}
}