Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: C++ / Real Time User Input  (Read 3342 times)

0 Members and 1 Guest are viewing this topic.

Sigma

  • Guest
C++ / Real Time User Input
« on: August 21, 2006, 05:38:09 PM »
I am creating a C++ console program using (Dev-C++ 4.9.9.2) on a WinXP.
The problem arises when I want to get user input.
For the sake of comparison say I made a Tetris game.
I mastered the part where I can detect if the arrow keys are pressed.
But what if the user doesn't press anything?  I want my program to continue
running regardless of user input and not have to wait for input to move.


if(KEYS_PRESSED){//<----[if nothing is being pressed move on]
//<----[interpret those keystrokes and move accordingly (this part is fine)]
}


MOVE_PIECE();//<----[this will happen even if user gives no input]



Just trying to avoid the "Press any key to continue" thing.