Such routines are non-standard and thus it's not readily available without some hacking. It's possible however, by using raw mode.
#include <proto/dos.h>
LONG readchar(BPTR fh);
int main(void)
{
Printf("0x%02lx\n", readchar(Input()));
return 0;
}
LONG readchar(BPTR fh)
{
LONG ret = -1;
if (IsInteractive(fh))
{
if (SetMode(fh, 1)) /* Attempt to go to raw mode */
{
UBYTE buf[4];
LONG actual;
do
{
actual = Read(fh, buf, sizeof(buf));
/* Read until single char or error */
} while (actual > 1);
SetMode(fh, 0); /* Go back to con mode */
if (actual == 1)
{
ret = buf[0];
}
}
}
else
{
ret = FGetC(fh);
}
return ret;
}