The Age Old Getch Problem: Need A C++ Replacement
Posted on 2006-06-01
After several years of programming, successfully I might add, on the windows platform using borland's c++ compiler, it has become painfully evident that after all these years, it has not yet become apart of the standard library to include to include an equivalent for the <conio> header file, even if it means using platfom specific code on the different compilers. I don't see the problem.
But anyway, my problem is that regardless of the reasons many persons, have proposed for using cin.get() or getchar() they still dont have the the functionallity of getch() to return each keypress character code, with echo turned off. Now I have recently learned that there is a way in linux/unix to cause getchar() to behave similarly to getch() by using functions from the <termino> header file (or something like that). So my question is, isn't there someway of telling cin.get() or getchar() to return that int code or char for the key pressed instead of waiting for newline to be input.
If someone knows a custom function that can deliver that particular functionallity, that would be good, but i would really like to see if there is a standard way it can be done.