#include <conio.h>

void main()
{
  unsigned char ch;

  do
  {
    ch = getch();
    if(ch)
    {
      printf(" Keycode: %d\n",ch);
    }
    else
    {
      ch = getch();
      printf(" Extended Code: %d\n",ch);
    }
  } while(ch!=27);
}
