Blame view

Modif/epsilon-master/ion/src/shared/events_stdin.cpp 398 Bytes
6663b6c9   adorian   projet complet av...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
  #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);
    }
  }