329f053cfae58e1689ea6609fce101cc4cf301fc
[oftp] / src / main.c
1 #include "tgfx.h"
2 #include "input.h"
3
4 int main(void)
5 {
6         union event ev;
7
8         init_input();
9
10         tg_bgchar(' ');
11         tg_clear();
12
13         tg_bgcolor(1);
14         tg_rect("Remote", 0, 0, 40, 23, TGFX_FRAME);
15         tg_rect("Local", 40, 0, 40, 23, TGFX_FRAME);
16
17         tg_bgcolor(0);
18         tg_fgcolor(7);
19         tg_text(0, 23, ">");
20         tg_setcursor(2, 23);
21
22         while(wait_input(&ev)) {
23                 switch(ev.type) {
24                 case EV_KEY:
25                         if(ev.key.key == 27) goto done;
26                         break;
27
28                 default:
29                         break;
30                 }
31         }
32
33 done:
34         tg_bgchar(' ');
35         tg_bgcolor(0);
36         tg_fgcolor(7);
37         tg_clear();
38
39         cleanup_input();
40         return 0;
41 }