SquirrelProdigy 0 Newbie Poster


SetConsoleMode(InputH,ENABLE_PROCESSED_INPUT|ENABLE_MOUSE_INPUT);
	while(1)
	{
		ReadConsoleInput(InputH,&InputRecord,1,&InputEvents);
		if(InputRecord.Key_Event)
		{
			if(InputRecord.Key_Code == VK_RIGHT) cout<<"You pressed right. Yay!"<<endl;
		}
	FlushConsoleInputBuffer(InputH);		
	}

There's the snippet. It takes in input correctly, but despite the FlushConsoleInputBuffer() line, it still echo's. What am I missing here?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.