#include unsigned char _stdcall _export ReadKey(void) { return (char)getch(); } unsigned _stdcall _export KeyPressed(void) { return (kbhit() != 0); } #if 0 #include int main(void) { char ch = 'a'; do { if ( KeyPressed ) { ch = ReadKey(); printf("%02x %c\n",ch,ch); } } while ( ch != ' '); return 0; } #endif