I believe that the function name for determining this will depend upon which user interface toolkit you use for your program. If you're doing GUI stuff, you could see what different event-handling functions are available in the toolkit (Qt, Gtk, glut, or whatever), one of which is likely to tell you the status of the keyboard.
If you're doing console programming, I'm not too sure...
|