I am getting the input (left arrow or right arrow)
using the following code:
(returns 2 for escape, 0 for left, 1 for right - keys ... and -1 just in case something else happens)PHP Code:
int grabinput()
{
char c;
c = getch();
if ((float) c == 27)
{
return 2;
}
else if ((float) c == 75)
{
return 0;
}
else if ((float) c == 77)
{
return 1;
}
fflush(stdin);
return -1;
}
Is there a better/standard way of doing this ? If so, how ?
www.akilla.tk