Reputation: 453
I need to get a char with ncurses, but when I get the char, I don't want it printed to the screen. Is there a way to do this?
Upvotes: 3
Views: 2825
Reputation: 302
Assuming you're using C
, you can use noecho();
.
The following is a relevant excerpt from the manual pages.
The
echo
andnoecho
routines control whether characters typed by the user are echoed bygetch
as they are typed. Echoing by the tty driver is always disabled, but initiallygetch
is in echo mode, so characters typed are echoed. Authors of most interactive programs prefer to do their own echoing in a controlled area of the screen, or not to echo at all, so they disable echoing by callingnoecho
.
Upvotes: 3