PDA

View Full Version : kbhit() and control-C


timetraveldude
May21-04, 04:48 PM
I have a programming running that waits for keyboard input. The problem is that when I press control-C to exit the program I get an error. I believe it is because the keyboard was pressed but the program is exiting before it can execute the code that is called when kbhit() is true. Any ideas.<br />
<br />
thanks.

dduardo
May22-04, 08:44 AM
What is the exact error message your getting? What library are you using? kbhit is a non-ansi standard function.

This is the best I could find:

http://groups.google.com/groups?q=control-c+kbhit&start=10&hl=en&lr=&ie=UTF-8&selm=1992Jun8.230725.20590%40tvnews.tv.tek.com&rnum=16

You can capture the Ctrl-C escape sequence and manually exit out of the program.

timetraveldude
May22-04, 12:13 PM
thanks for the help.