View Single Post
Old May 5th, 2007, 2:42 AM   #2
grumpy
Programming Guru
 
grumpy's Avatar
 
Join Date: Jun 2005
Location: Adelaide, South Australia
Posts: 1,223
Rep Power: 5 grumpy is on a distinguished road
Not possible. There is no way in the standard C or C++ libraries to receive individual keystrokes. That's because the standard libraries are based around a pretty generic computing device (and, generically, a computing device may not have a keyboard).

If you are targeting a machine with a keyboard, most compilers you will be using and their libraries include functions that provide some means of obtaining keystrokes directly. You need to read your compiler and library documentation to find out how to do it. Keep in mind that the method varies between compilers and systems. If you want to use curses or similar, look up raw input.
grumpy is offline   Reply With Quote