Re: Linux: Unbuffered reading from stdin



Markus Mayer wrote:
Hi folks.

I'm somewhat new to *nix programming and just ran into a problem. I have
to take user input from the terminal but like to constrain that to some
rules given, i.e. "numbers only" or "alphanumeric only" etc.
scanf would do, but I don't like the fact that wrong ('disallowed')
characters are visible and all that stuff. For that I need unbuffered
input.

However things become nasty when the user presses an key that sends an
escape sequence.


Any ideas? Or am I reinventing the wheel?

This is really a comp.unix.programming question, but it
sounds like ncurses is what you want.

--
imalone
.