/* kbtest.c Jeff Ondich, 5/15/08 Uses kbhit.h and kbhit.c, which come from http://www.linux-sxs.org/programming/kbhit.html, which in turn took the code from "Beginning Linux Programming" by Neil Matthew and Richard Stones, Wrox Press. Compile like so: gcc -Wall -o kbtest kbtest.c kbhit.c */ #include #include #include "kbhit.h" int main() { char ch = '\0'; init_keyboard(); while( ch != 'q' ) { if( kbhit() ) { ch = readch(); printf( "You said: %c\n", toupper(ch) ); } } close_keyboard(); return 0; }