ReadKey like Function in C
Tim_CDC_Roberts at cup.portal.com
Tim_CDC_Roberts at cup.portal.com
Fri Aug 11 03:47:23 AEST 1989
In article <941 at lakesys.UUCP>, Dave Fenske writes:
>In article <207600029 at s.cs.uiuc.edu> mccaugh at s.cs.uiuc.edu writes:
> >
> > Wait a minute -- am I missing something here? Isn't conventional
> > (Kernighan-Ritchie) C supoosed to be capable of system-calls to
> > the operating-system, say, to switch I/O-mode from cooked to raw,
> > thereby obviating the <CR> on char-input, then switching back when
> > done?
>
>Absolutely! You need only do the following:
>
>1. do an "ioctl (n, TCGETA, &term)
> (remainder deleted)
Ah, but this is not a C solution, K&R or otherwise. It is a UNIX solution.
Definitively, once again:
THERE IS NO STANDARD, O.S.-TRANSPARENT METHOD OF READING A SINGLE
KEYSTROKE WITHOUT A CR. Never has been, never will be.
If the original questioner rephrases to: "How can I do a ReadKey in
Microsoft C 5.0 on MS-DOS", THEN there is an answer. However, the
question "How can I do a ReadKey in C?" has no correct unqualified answer.
Tim_CDC_Roberts at cup.portal.com | Control Data...
...!sun!portal!cup.portal.com!tim_cdc_roberts | ...or it will control you.
More information about the Comp.lang.c
mailing list