[Coco] C and BASIC09 (Auto-discard notification)

Robert Gault robert.gault at worldnet.att.net
Sun May 16 06:25:25 EDT 2004

Mannequin* wrote:
> On Sat, 15 May 2004 22:27:37 -0400
> Robert Gault <robert.gault at worldnet.att.net> wrote:
>>My suggestion would be to look at the getchar standard library call. 
>>However, you have still not said exactly what you are trying to 
>>accomplish. Do you want your program to respond to the keyboard 
>>regardless of where you are in your program or do you only need
>>keyboard input at a specific time? How many characters will you need
>>to trap? Will you need to process the keyboard input or only know that
>>some key has been pressed?
> Sorry about the last post... I sometimes forget which email address I'm
> using for a given list. :(
> Anyway, I need it to get and process most (if not all) of the keys that
> are hit on the keyboard. I need something like the "getch ()" function
> that is used in Borland's bcc compiler for the x86. (I'll be using it in
> an "endless" loop until some criteria are met.)
> Like I said, I posted about this on a different Coco list before, but I
> need to know if it can capture key combos like <CTRL><A> along with all
> of the normal characters and symbols. In this way, I don't see how
> standard "getchar ()" can help unless you somehow strip the buffering.
> (Which I have no idea how to do in OS-9.)
> Any help or suggestions you can give would be great.
> Thanks!
> -M.

OK, you actually are asking how OS-9 processes keyboard information not 
C. OS-9 as with most OSes will filter multiple key presses and special 
key entries and release the standard ascii data set. To access the 
special keys, study the OS-9 GetStatt call SS.KySns and how to call it 
from C. If that won't do the job, you will need to write your own 
keyboard driver routine in assembly and interface it with C.

More information about the Coco mailing list