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

Bill Pierce ooogalapasooo at aol.com
Tue Apr 23 20:34:48 EDT 2013


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
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

-- 
Long live the CoCo

--
Coco mailing list
Coco at maltedmedia.com
http://five.pairlist.net/mailman/listinfo/coco

 



More information about the Coco mailing list