Mail Archives: djgpp/1996/07/26/21:52:17
Reply to message 2035076 from BLUESTAR AT DOMI on 07/26/96 6:42AM
>How can I check the keyboard buffer to see if there is someething waiting
>and if its an direction key how can I dertermine which one is it ??
>I use kbhit and getch but after getch I only get 0 ??
>
>How can I determine the key
This is hardly a DJGPP specific question; any decent C text or teacher
can tell you about extended key codes. Anyway, when you press a
key that doesn't have an ANSI code (like an arrow key, function key,
Alt-key, etc.), the BIOS first returns a null character (0) to signify an
extended key, and then returns the actual extended keycode. You
have to have your program recognize this and call getch() a second
time.
For a list of extended keycodes, see any competent programming
book. It doesn't even have to be for C; every language uses them.
John
- Raw text -