ReadConsoleInput? or what?

Hi Everybody!

I'm making a videogame, the fact is, that I need something that waits until I press a Character, some kind of multithreading, I don't know. If no character was pressed, then it should continue executing its processes.

Any ideas?

just something like

1
2
3
4
cin.get();
//wait a second
//NO key was pressed?
dosomething();


the time that we have to wait will be the same, even if we press any key

ps. It is really necessary to be a console game, I know, there are libraries like NCurses. :D
Last edited on
By the way, SFML will help out with this?

and by the way, that's the only functionality that I want :O

No graphics, no sound, just that :L
Last edited on
Hmmm well, someone that could give me an example for multithreading that calls a thread to wait for some input and after some time has passed, it returns to our main app?
Yes, use SFML's input facilities. When the user presses a key (or moves the mouse or joystick or whatever), the computer makes a log of it and sticks it in an "event queue" that your program should be monitoring. (If you are using SMFL, that is pretty much done for you.)

You don't need multithreading for that.
Topic archived. No new replies allowed.