doskeyb
diff test.c @ 2:da4c014bb055
implemented kb_isdown(KB_ANY) correctly
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Mon, 23 Sep 2013 04:07:09 +0300 |
parents | c2b210a70ce9 |
children |
line diff
1.1 --- a/test.c Mon Sep 23 03:45:39 2013 +0300 1.2 +++ b/test.c Mon Sep 23 04:07:09 2013 +0300 1.3 @@ -12,6 +12,15 @@ 1.4 */ 1.5 kb_init(16); 1.6 1.7 + printf("Press any key to continue ...\n"); 1.8 + 1.9 + /* example of active polling... The same can be done better by using 1.10 + * kb_wait() 1.11 + */ 1.12 + while(!kb_isdown(KB_ANY)); 1.13 + kb_getkey(); /* discard the key we just detected */ 1.14 + 1.15 + printf("Key tester, quit by pressing esc\n"); 1.16 for(;;) { 1.17 kb_wait(); /* wait for any keypress */ 1.18 key = kb_getkey(); /* get the pressed key */