Function/arrow keys are two-character values, 0+key or scan code
Try this program to get the values of your keys in Windows. It'll also show you a way to deal with the function keys.
Code:
#include <stdio.h>
#include <conio.h>
int main()
{
int i;
i = 0;
while (i != 0x1B) // exit on ESC
{
i = getch();
printf(" %02X ", i);
if (i > 0x20 && i < 0x7F) // If printable
printf("[%c] ", i); // ... output the character
if (i == 0) // test for a function key
{
i = getch();
printf("%02X ", i);
if (i > 0x20 && i < 0x7F)
printf("[%c] ", i);
}
printf("\n");
}
}
Yes, you could use isprint() but I wanted to limit the header files.
Also, the FAQ mentions the "other" value that a few keys use instead of 0, 0xE0 (224) which you can also look for. I forgot which keys they are for, but they may be necessary if you want to check for ALL possible keys.