Numworks Epsilon
1.4.1
Graphing Calculator Operating System
events_replay.cpp
Go to the documentation of this file.
1
#include <
ion.h
>
2
3
/* Use this implementation of Ion::Events::getEvent to simulate pre-recorded key
4
* presses. This implementation doesn't wait at all, which can be useful when
5
* profiling code execution. */
6
7
const
int
loopLength
= 12;
8
9
using namespace
Ion::Events
;
10
11
const
Event
sequence
[] = {
12
Right
,
13
Right
,
14
Right
,
15
OK
,
16
Down
,
Down
,
Down
,
Down
,
Down
,
Down
,
17
Up
,
Up
,
Up
,
Up
,
Up
,
Up
18
};
19
20
Event
Ion::Events::getEvent
(
int
* timeout) {
21
static
int
i = 0;
22
int
sequenceLength =
sizeof
(
sequence
)/
sizeof
(
sequence
[0]);
23
if
(i == sequenceLength) {
24
i = sequenceLength -
loopLength
;
25
}
26
if
(i > sequenceLength) {
27
while
(1) {
28
}
29
}
30
return
sequence
[i++];
31
}
Ion::Events::getEvent
Event getEvent(int *timeout)
Definition:
events.cpp:12
ion.h
sequence
const Event sequence[]
Definition:
events_replay.cpp:11
Ion::Events::Up
constexpr Event Up
Definition:
events.h:62
Ion::Events::Down
constexpr Event Down
Definition:
events.h:63
Ion::Events
Definition:
events.h:7
Ion::Events::Event
Definition:
events.h:9
Ion::Events::Right
constexpr Event Right
Definition:
events.h:64
Ion::Events::OK
constexpr Event OK
Definition:
events.h:65
loopLength
const int loopLength
Definition:
events_replay.cpp:7
epsilon
ion
src
shared
events_replay.cpp
Generated by
1.8.14