[Coco] [Color Computer] INKEY equivalent for C?

Bob Devries bdevries at gil.com.au
Sun Dec 25 18:55:16 EST 2005

Problem with getchar() is that the stdin stream is by default buffered. You 
need to do the following to set the buffering to 0:

stdout->_flag |= _UNBUF;
stdin->_flag |= _UNBUF;

Just insert that somewhere *before* you get any keyboard input in your 

Regards, Bob Devries, Dalby, Queensland, Australia

Isaiah 50:4 The sovereign Lord has given me
the capacity to be his spokesman,
so that I know how to help the weary.

website: http://www.home.gil.com.au/~bdevasl
my blog: http://bdevries.invigorated.org/

----- Original Message ----- 
From: "Robert Gault" <robert.gault at worldnet.att.net>
To: "CoCoList for Color Computer Enthusiasts" <coco at maltedmedia.com>
Sent: Monday, December 26, 2005 9:45 AM
Subject: Re: [Coco] [Color Computer] INKEY equivalent for C?

> There is an OS-9 C library function that should do the job, getchar.
> #include <stdio.h>
> char getchar()
> Getchar returns a character from the standard input.
> James Gerrie wrote:
>> Can someone tell me how to get an INKEY like function for OS9 C for the 
>> CoCo?  Is there something like a KBHIT function that someone has created. 
>> A work around?
>> Jim G
> -- 
> Coco mailing list
> Coco at maltedmedia.com
> http://five.pairlist.net/mailman/listinfo/coco
> -- 
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.371 / Virus Database: 267.14.7/214 - Release Date: 23/12/2005

More information about the Coco mailing list