[comp.lang.ada] How do you read keystrokes in Ada?

meyer@uw-june (Kurt T. Meyer) (05/04/89)

Hi, I need to figure out how to read a single keystroke in
Ada.  As far as I can tell, all available I/O routines wait
for a carriage return before returning input read from the
keyboard.  Does anyone out there know of some code that does
this?  I'm working with Ada on Vax/VMS.

Thanks in advance!

--Kurt (meyer@june.cs.washington.edu)

ecragg@GMUVAX.GMU.EDU ("EDWARD CRAGG") (05/04/89)

There are no standard procedures in Ada for a live keyboard.  Our 
solution was to write package IMMEDIATE_IO which is a TEXT_IO clone
(and interchangeable with TEXT_IO) which passes all calls except 
actual GETs and PUTs to TEXT_IO, GETs and PUTs are processed by direct
QIOW's.  I have beta-test quality versions for both DEC Ada and ALS/N
ADAVAX.


 ............................................................
Edward E Cragg                Bitnet:   ECRAGG@GMUVAX
                              Internet: ECRAGG@GMUVAX.GMU.EDU

RCONN@WSMR-SIMTEL20.ARMY.MIL (Rick Conn) (05/11/89)

The recently-announced ADA-TUTR in the Ada Software Repository
contains routines for single-character I/O using Verdix Ada on a SUN
(via a C interface), DEC Ada on a VAX (via the VAX/VMS I/O library), and
a second UNIX-C interface (I don't know the origin).  These routines are
isolated in a system dependency package.  See the file in PD1:<MSDOS.ADA> and
PD2:<ADA.EDUCATION> (comment file containing Verdix Ada/SUN).

	Rick
-------

jwolf@hpcupt1.HP.COM (John Wolf) (05/13/89)

If REPRESENTATIVE CLAUSES for interrupt vector addresses are supported
by your compiler then you could write your own charactor I/O interrupt
handler via Ada Tasking.  See REPRESENTATIVE CLAUSE in the green book.
This would be a way to keep all your code Ada, i.e. not linking to
any foreign language objects (this would make the DoD happy).  But I have
yet to find an Ada compiler where REPRESENTATIVE CLAUSES for interrupt 
vectors are supported.  Think of the Real-Time possibilities with High-Level 
language programming if it were implemented.

jwolf@hpda.HP.COM