Advertisement

Reading Console Input

Started by January 15, 2003 03:34 PM
0 comments, last by Tech19 21 years, 10 months ago
Hey, I have a program that i want to close when the user presses the escape key so i used the following code:
  
ReadConsoleInput(hInput, &InputRecord, 1,&Events);  
if(InputRecord.Event.KeyEvent.wVirtualKeyCode  == VK_ESCAPE)
	{
	     bstillplaying = false;
	}
    
however when i run my program it waits for console input before deciding what to do. I want it to do other things in the program and only if Escape is pressed then close the program. any help appreciated! [edited by - Tech19 on January 15, 2003 4:35:06 PM]
Check out kbhit()

This topic is closed to new replies.

Advertisement