#include <conio.h> #include <stdio.h> int main () { int iCode; while (1) { iCode = getch (); if (iCode == 0) { iCode = getch (); printf ("\nEXTENDED KEY CODE: %d", iCode); } else { // 'iCode' is not zero printf ("\nNORMAL KEY CODE: %d", iCode); } if (iCode == 27) { // 27 is key code for ESC key break; // Quit to DOS. } } return 0; } |