As 2ffat says, you have to read the key twice for an extended code. Here's how in the DOS environment (Windows is different) :<br>
<br>
a = getch(); /* Get key press */<br>
if (a == 0 ¦¦ a == 0xE0) { a = getch() + 0x100; } /* Add 256 if extended: This makes the rest of the code easier to write */<br>
switch ( a )<br>
{<br>
case 27: /* If escape key */<br>
printf( "Exiting..." );<br>
goto end; /* Sorry

*/<br>
case 328: /* If Up Arrow key */<br>
/* Do stuff for Up Arrow Key */<br>
break;<br>
case 336: /* If Down Arrow key */ <br>
/* Do stuff for Down Arrow Key */<br>
break;<br>
<br>
The rest of the keycodes can be figured out by putting this into the above code before the switch(a) statement:<br>
<br>
printf("Keycode is %d\n", a );<br>
<br>
I hope this helps. <p> <br><a href=mailto:Kim_Christensen@telus.net>Kim_Christensen@telus.net</a><br><a href=
Page</a><br>