#include <conio.h> int main (void) { for (;;) { unsigned char ch = getch(); printf ("0x%02X\n", ch); } }
I want to get a scan code.
Here is a description from Wikipedia :
Reads a character directly from the console without buffer, and without echo.
When I hit Del , it shows 0xE0 0x53.
When I pressed Ctrl + PgUp , it shows 0xE0 0x86.
Although some of them are the same as in the table, most of the values that it shows are different from them.
So, does getch() really get scan codes?
Here is the scan code table (usually used 2)

source share