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 ;)
This seems to be unmanaged C++, if so you posted in the wrong forum. Maybe this will do it:
while(!kbhit()||getch()!=27) {...}
:)Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips: - make Visual display line numbers: Tools/Options/TextEditor/... - show exceptions with ToString() to see all information - before you ask a question here, search CodeProject, then Google