Auto entry

Jun 19, 2013 at 8:54pm
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?
Jun 19, 2013 at 11:51pm
closed account (NUj6URfi)
Bump.
Jun 20, 2013 at 12:57am
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 Jun 20, 2013 at 1:01am
Jun 20, 2013 at 3:14am
You want unbuffered input from console.
you can use ncurses.
Jun 20, 2013 at 10:47am
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;
} 

Jun 20, 2013 at 12:16pm
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.