Auto entry

closed account (NUj6URfi)
I am working on a program that has the user type one character. How can I get the program to automatically accept the character? Also how can I set the mouse to do something?
closed account (NUj6URfi)
Bump.
If the question is "How do I programmatically retrieve input from the user without requiring the user to press enter or how do I programmatically check the state of the keyboard" then the answer is that you cannot within the bounds of standard C++. You must use some operating system specific method or a library that does that for you.

The same is true of the mouse. Googling will probably prove useful.

[Edit: Also, don't bump your posts only a few hours after you've made them. If you must bump a post, consider that not enough information was provided in the original or that the original question wasn't clear enough, so provide more info and clarify. "Bump" means "Hey! My post is more important than other posts, read it again!" which isn't likely to gain you many fans here, particularly as general and vague as your questions have tended to be so far.]
Last edited on
You want unbuffered input from console.
you can use ncurses.
closed account (NUj6URfi)
I downloaded pdcurses for windows. I am using dev-c++. I put the headers in the correct spot. My code is

1
2
3
4
5
6
7
8
#include <curses.h>
#include <panel.h>

int main () 
{
    initscr;
    getch;
} 

Well, that's not going to work.

You need to learn how to call those functions:
http://www.cplusplus.com/doc/tutorial/functions/
Topic archived. No new replies allowed.