Reading from keyboard without echo

Mats T. Nilsson
Mon Apr 3 00:36:00 GMT 2000


I'm running Cygwin in a Win98 window.

In a "plain vanilla" C-program I want to poll the keyboard an when a key
is pressed I want to read it without having the character echoed to the

I have managed to arrange th polling using select, but I haven't been
able to read the character.

I've tried getc(), gerchar(), fread() and read() but all these functions
echo the character and will block until the CR is pressed after the key.
This CR is the main problem since it scrolls the content of the window.

Any hints?

Mats Nilsson                    Email:
Ericsson Radio Systems AB       WWW:
NA/ERA/RL/KE                    Phone/mobile: + 46 8 50878078
Augustendalsvägen 21 (10B31)    Home:         + 46 8 7201233
SE-131 89 STOCKHOLM, SWEDEN     Fax:          + 46 8 4220540
PGP-key  0x91BAB71D  DEF5 B013 07C4 84C3 1CEE 15DE E345 1668 91BA B71D
PGP-key  0x5DA31679  1844 9D0B E17C 96C9 D440 CA96 CF8B C0E0

Want to unsubscribe from this list?
Send a message to

More information about the Cygwin mailing list