Need Help: 1-char input in C
Guy Harris
guy at rlgvax.UUCP
Sat Dec 31 17:56:22 AEST 1983
Two small addenda to Mr. Fritz's suggestion:
1) Doing the IOCTL's yourself will not just be faster than using
system("stty cbreak"), it will be *massively* faster if "cbreak" mode is
turned on or off more than once per session.
2) The user should ensure that "resetline" is called whenever the program
exits, even if the program is being terminated because the user hit their
interrupt key. The program should catch the SIGINT signal, and the
routine which catches this signal should restore the terminal modes and then
exit.
Guy Harris
{seismo,ihnp4,allegra}!rlgvax!guy
More information about the Comp.lang.c
mailing list