I think you probably mean a kbhit() style function, again this (using conio.h) is non standard but the faq link is here kbhit - C++ Function Reference

Bear in mind to keep track of all your data...