X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fmain.c;h=329f053cfae58e1689ea6609fce101cc4cf301fc;hb=8091cf11d15e1363d8d608fb640f4f12b0887e52;hp=5fb66a608c69aea223dab6eef0e9fdd15b4985a0;hpb=6478a82a947e3662c31b95682661f2de9952944d;p=oftp diff --git a/src/main.c b/src/main.c index 5fb66a6..329f053 100644 --- a/src/main.c +++ b/src/main.c @@ -1,8 +1,12 @@ -#include #include "tgfx.h" +#include "input.h" int main(void) { + union event ev; + + init_input(); + tg_bgchar(' '); tg_clear(); @@ -10,15 +14,28 @@ int main(void) tg_rect("Remote", 0, 0, 40, 23, TGFX_FRAME); tg_rect("Local", 40, 0, 40, 23, TGFX_FRAME); + tg_bgcolor(0); tg_fgcolor(7); - tg_text(0, 24, "fooolalala bar"); -/* tg_setcursor(2, 24);*/ + tg_text(0, 23, ">"); + tg_setcursor(2, 23); - while(getch() != 27); + while(wait_input(&ev)) { + switch(ev.type) { + case EV_KEY: + if(ev.key.key == 27) goto done; + break; + default: + break; + } + } + +done: tg_bgchar(' '); tg_bgcolor(0); tg_fgcolor(7); tg_clear(); + + cleanup_input(); return 0; }