Simple ESC Key
-
Hey everyone, I've got a C++ console application and it goes into a loop while that never ends except when the user presses the ESC key! Right now my loop is coded like this: while (!kbhit()) { code } I have to change the kbhit bit to make it so it only ends the loop when I press the ESC key! Thanks for your help in advance, I appreciate it! Michael
-
Hey everyone, I've got a C++ console application and it goes into a loop while that never ends except when the user presses the ESC key! Right now my loop is coded like this: while (!kbhit()) { code } I have to change the kbhit bit to make it so it only ends the loop when I press the ESC key! Thanks for your help in advance, I appreciate it! Michael
-
it is mush simple if it is like that. while ( (ch = getch())!= 27 ) { /// loop statements } Thank You. hiren thakkar
-
it is mush simple if it is like that. while ( (ch = getch())!= 27 ) { /// loop statements } Thank You. hiren thakkar
-
It is wrong... The loop will be blocked, because getch will wait for key hit. The loop will be executed in each key strokes...
- NS -
yes , Your are right. Sorry i was missed interpreted that. Then your code is absolutely right