X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fmain.c;h=2323ea3eb8ffccb13dc9aaaa4bf3e4dd32fed9fa;hb=5363ed21fccc528965a8482b3b71fe0133595499;hp=5fb66a608c69aea223dab6eef0e9fdd15b4985a0;hpb=14156fa6d891446da30854a562d62652fb5d30b9;p=oftp diff --git a/src/main.c b/src/main.c index 5fb66a6..2323ea3 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(); @@ -14,11 +18,23 @@ int main(void) tg_text(0, 24, "fooolalala bar"); /* tg_setcursor(2, 24);*/ - 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; }