* Routines dealing with getting input from the keyboard (i.e. from the user).
* Open keyboard for input.
* Open a new handle to CON: in binary mode
* for unbuffered keyboard read.
tty
= open("CON", O_RDONLY
|O_BINARY
);
* If that doesn't work, use file descriptor 2,
* which in Unix is usually attached to the screen,
* but also usually lets you read from the keyboard.
tty
= open("/dev/tty", 0);
* Get a character from the keyboard.
result
= iread(tty
, &c
, sizeof(char));
* Don't call error() here,
* because error calls getchr!
* In raw read, we don't see ^C so look here for it.
* Various parts of the program cannot handle
* an input character of '\0'.
* If a '\0' was actually typed, convert it to '\200' here.