Find out with the code below what values the keys return
my system returns something like
72,75,80 and something else....
Most keys place only one value in the buffer... the arrow keys however place 2 224, ? depending on which arrow key was pressed. That is why I test for the value 224. Your system may or may not place that value there....
Code:
#include<iostream.h>
#include<conio.h>
void main(void)
{
while(1)
{
while(!kbhit());
int i = getch();
if( i == '0')
break;
if( i == 224 ) //whenever an arrow key is pressse my
i = getch(); //system returns 224 prior to the key val
cout << "You pressed key number: " << i << endl;
}
}