[Coco] How to detect a key pressed in OS-9

Gene Heskett gheskett at wdtv.com
Wed Apr 24 00:39:34 EDT 2013


On Wednesday 24 April 2013 00:36:09 Retro Canada did opine:

> no that wont help need to continue the processing while a key is not
> pressed
> 
> Sent from my iPhone
> 
> On 2013-04-23, at 8:34 PM, Bill Pierce <ooogalapasooo at aol.com> wrote:
> > Luis,
> > You can use I$Read & I$ReadLn in asm, Inkey in Basic09 (external sub),
> > and read, readln, and several others in C. The only thing is that in
> > OS9, most reads will "wait" for a key. Unlike Basic's INKEY$ that
> > will just look tyo see if a key was pressed and return. I think Inkey
> > for Basic09 acts just like Basic's INKEY$. The difference between
> > Read & readln is that read will not return untill the number of
> > characters specified have been read (read(port,buffer,no chars).
> > ReadLn will read the number of characters OR return on carriage
> > return. Both commands return the nuber of characters read in B, keys
> > read in buffer.
> > 
> > Hope that helps
> > 
> > Bill Pierce

If you want not blocking behavior, in assembly there is a gttstt for that, 
I'd quote which but I took the docs back to the basement 2 weeks ago while 
trying to find all my income tax crap.

> > My Music from the Tandy/Radio Shack Color Computer 2 & 3
> > https://sites.google.com/site/dabarnstudio/
> > Co-Webmaster of The TRS-80 Color Computer Archive
> > http://www.colorcomputerarchive.com/
> > Co-Contributor, Co-Editor for CocoPedia
> > http://www.cocopedia.com/wiki/index.php/Main_Page
> > E-Mail: ooogalapasooo at aol.com
> > 
> > 
> > 
> > 
> > -----Original Message-----
> > From: Luis Antoniosi (CoCoDemus) <retrocanada76 at gmail.com>
> > To: CoCoList for Color Computer Enthusiasts <coco at maltedmedia.com>
> > Sent: Tue, Apr 23, 2013 8:01 pm
> > Subject: [Coco] How to detect a key pressed in OS-9
> > 
> > 
> > Hi,
> > 
> > KySns seems to detect only the 8 directional, control, shift and space
> > keys.
> > 
> > But how to detect any key was pressed prior to read it ? Like in
> > Basic:
> > 
> > IF INKEY$<>"" THEN...
> > 
> > thxs
> 
> --
> Coco mailing list
> Coco at maltedmedia.com
> http://five.pairlist.net/mailman/listinfo/coco


Cheers, Gene
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
My web page: <http://coyoteden.dyndns-free.com:85/gene> is up!
My views 
<http://www.armchairpatriot.com/What%20Has%20America%20Become.shtml>
I've finally found the perfect girl,
I couldn't ask for more,
She's deaf and dumb and over-sexed,
And owns a liquor store.
A pen in the hand of this president is far more
dangerous than 200 million guns in the hands of
         law-abiding citizens.



More information about the Coco mailing list