// TURBO C and VC6.0 tested #include #include void main() { int c1, c2; while (!kbhit()); c1 = getch(); if ((c1 == 0xe0)||(c1==00)) { c2 = getch(); printf("c1=%#02x c2=%#02x",c1, c2); } else printf("c1=%#02x",c1); } /* TURBO C nonprintable characters: c1 c2 F1 00 3b F2 00 3c F3 00 3d F4 00 3e F5 00 3f F6 00 40 F7 00 41 F8 00 42 F9 00 43 F10 00 44 F11 -- -- F12 -- -- ESC 1b -- Enter 0d -- PrtScr -- -- ScrLck -- -- Pause -- -- up 00 48 shift-up down 00 50 shift-down left 00 4b shift-left right 00 4d shift-right ctrl-up -- -- ctrl-down -- -- ctrl-left 00 73 ctrl-right 00 74 shift-a 41 -- a 61 -- ctrl-a 01 -- VISUAL C nonprintable characters: c1 c2 F1 00 3b F2 00 3c F3 00 3d F4 00 3e F5 00 3f F6 00 40 F7 00 41 F8 00 42 F9 00 43 F10 00 44 F11 -- -- F12 -- -- ESC 1b -- Enter 0d -- PrtScr -- -- ScrLck -- -- Pause -- -- up e0 48 shift-up down e0 50 shift-down left e0 4b shift-left right e0 4d shift-right ctrl-up e0 8d ctrl-down e0 91 ctrl-left e0 73 ctrl-right e0 74 shift-a 41 -- a 61 -- ctrl-a 01 -- */