for (;;) { key=bioskey(0); /* wait for a keystroke */ printf("0x%x\n",key); if (key==0x11b) break; /* Escape */ }