Detecting esc... or any other key (kbhit()) alternative.
I am writing an application in Linux to display certin text and hex images on a large LCD screen and everything seems to be working fine except: I wrote a "commander" to issue instructions, I have it set on a loop to refresh the display data and if want to stop it (break) to issue a new command then I have to use ctrl+c which exits the entire application. I would like to beable just to hit esc or any other key so I just break the loop and not the whole application. I found a function which works under Windows (kbhit()) but is included in the conio.h header so it doesn't work under Linux...
if (kbhit()) break; is what I wold use under Windows, is there an ANSI-C or C++ alternative that would work under Linux?
Thanks :)