ya using the getch is the good idea to tap the keyboard..
but i guess its not pretty good idea to use the getch() directly
since it waits for the keystroke.. always and pause the screen...
you can use it like this..
for eg..
if(kbhit())
{
switch(getch()) //monitor key stroke
{
case 80: //Down arrow
Focus(CFP+1); break;
case 72: //Up arrow
Focus(CFP-1); break;
case 13: //Enter
RESPOND=CFP; break;
case 27: //Esc
RESPOND=27;
}
}
I have always wonder how to tap the Function key (F1, F2, F3... F12)... Somebody know then help us out..
Rhohitman
Junior Poster in Training
86 posts since Dec 2007
Reputation Points: 10
Solved Threads: 5
ya using the getch is the good idea to tap the keyboard..
but i guess its not pretty good idea to use the getch() directly
since it waits for the keystroke.. always and pause the screen...
you can use it like this..
for eg..
if(kbhit())
{
switch(getch()) //monitor key stroke
{
case 80: //Down arrow
Focus(CFP+1); break;
case 72: //Up arrow
Focus(CFP-1); break;
case 13: //Enter
RESPOND=CFP; break;
case 27: //Esc
RESPOND=27;
}
}
I have always wonder how to tap the Function key (F1, F2, F3... F12)... Somebody know then help us out..
Rhohitman
Junior Poster in Training
86 posts since Dec 2007
Reputation Points: 10
Solved Threads: 5
If you're going to use windows.h's Beep() instead of the old non-ANSI _beep(), you might as well use Window's GetKeyState(), or GetKeyboardState().
MosaicFuneral
Posting Virtuoso
1,691 posts since Nov 2008
Reputation Points: 888
Solved Threads: 116