home *** CD-ROM | disk | FTP | other *** search
- README 18/12/92
-
-
- K B D $ R O U T I N E S
-
-
- << Single keypress under VMS in C, Pascal and Ada >>
-
-
- Copyright (C) 1992 Centre d'Etudes de la Navigation Aerienne.
- Author: Martin VICENTE (DGAC/CENA/SID)
- E-mail: vicente@cenaath.cena.dgac.fr
- Mail: C.E.N.A. - Orly Sud 205 - 94 542 ORLY AEROGARE CEDEX, FRANCE
-
-
- How to detect a single keystroke under VMS (without RETURN) ?
- *************************************************************
-
- Perhaps many of you did have to solve this problem, and had found
- solutions: SMG$ libraries, system calls.
-
- Calling a SMG Run-Time Library's routine permit effectively to solve
- it (polling on SMG$READ_KEYSTROKE with no time-out), but it has a
- disastrous consequences over CPU load.
-
- the system call solution is certainly the best one, but this need to
- be initiate.
-
- So we developped this RTL's extension which thus offers to users an
- interface much easier to manipulate.
- It is accessible to C, Pascal and Ada developer.
-
-
- The package contains these files:
- *********************************
-
- In C:
-
- KBD$ROUTINES.H Header file
- DEMO_KBD$ROUTINES.C Demonstration program
-
- In Pascal:
-
- PASCAL$KBD_ROUTINES.PAS Routine declaration
- DEMO_KBD$ROUTINES.PAS Demonstration program
-
- In Ada:
-
- KBD_.ADA Specification declaration
- DEMO_KBD_ROUTINES.ADA Demonstration program
-
-
- The KBD library is made of 6 routines:
- **************************************
-
- KBD$CLOSE_KEYBOARD: Free memory from data-structures associated to this
- unit.
-
- KBD$CVT_ANSI_SMG: Convert the ANSI sequence of a key into a SMG code.
-
- KBD$FLUSH_KEYBOARD: Empty the keyboard buffer.
-
- KBD$KEY_PRESSED: Indicate if at least one key is present in the buffer.
-
- KBD$OPEN_KEYBOARD: Creation and initialization of the data-structures
- associated to the unit.
-
- KBD$READ_KEYSTROKE: Extract the next key from the buffer; if the latter is
- empty, wait for an action onto the keyboard.
-
-
- implementation's description
- ****************************
-
- This unit is based on the producer-consumer algorithm, uses VAX/VMS
- primaries (System Services: $GETDVI, $QIO, etc), a breaking subroutine
- (AST) and the PASCAL$PPL_ROUTINES library.
-
- The producer is a breaking subroutine activated by an action onto
- the keyboard, feeding a buffer memory. The consumer is the
- KBD$READ_KEYSTROKE which take, each call, an ANSI sequence from buffer
- memory. The keyboard's buffer is managed in a circle.
-
- When the buffer is full, the user is warned by a sound beep.
-
-
- PRACTICAL USE:
- **************
-
- 1/ Create your own object library:
-
- $ LIBRARY/CREATE/OBJECT MYLIB
-
- If you want do give another name to the library, or if you have already
- got one, you've got to modify the "LIB" variable in the BUILD.COM file.
-
- 2/ Compile and insert KBD$ROUTINES unit into the library:
-
- $ @BUILD
- $ @BUILD 3 (ou KP3)
-
- 3/ Compile and insert error messages into the library:
-
- $ MESSAGE KBDMSG
- $ LIBRARY/REPLACE MYLIB KBDMSG
-
- 4/ In Pascal
-
- $ PASCAL DEMO_KBD$ROUTINES
- $ LINK DEMO_KBD$ROUTINES, MYLIB/LIBRARY
- $ RUN DEMO_KBD$ROUTINES
-
- 5/ In C
-
- $ CC DEMO_KBD$ROUTINES
- $ LINK DEMO_KBD$ROUTINES, MYLIB/LIBRARY, LINK_CC.OPT/OPTION
- $ RUN DEMO_KBD$ROUTINES
-
- 6/ In Ada
-
- $ ACS SET LIBRARY MYLIBADA
- $ ADA KBD_
- $ ADA DEMO_KBD_ROUTINES
- $ DEFINE LNK$LIBRARY MYLIB
- $ ACS LINK DEMO_KBD_ROUTINES
- $ DEASSIGN LNK$LIBRARY
-