home *** CD-ROM | disk | FTP | other *** search
- (*
- ------------------ Distribution and Copyright -----------------
- --
- -- This software is copyright by the CENA/DGAC/FRANCE
- -- All rights reserved.
- --
- -- No part of the material protected by this copyright notice
- -- may be reproduced or utilized for commercial use in any form
- -- without written permission of the copyright owner.
- --
- -- It may be reproduced or utilized for R&D use in Non Profit
- -- Organization
- --
- ---------------------------------------------------------------
-
-
- ------------------ Disclaimer ---------------------------------
- --
- -- This software and its documentation are provided "AS IS" and
- -- without any expressed or implied warranties whatsoever.
- -- No warranties as to performance, merchantability, or fitness
- -- for a particular purpose exist.
- --
- -- Because of the diversity of conditions and hardware under
- -- which this software may be used, no warranty of fitness for
- -- a particular purpose is offered. The user is advised to
- -- test the software thoroughly before relying on it. The user
- -- must assume the entire risk and liability of using this
- -- software.
- --
- -- In no event shall any person or organization of people be
- -- held responsible for any direct, indirect, consequential
- -- or inconsequential damages or lost profits.
- --
- -------------------END-PROLOGUE--------------------------------
- *)
-
-
-
-
- (*****************************************************************************)
- (*****************************************************************************)
- (** **)
- (** D E M O D E S R O U T I N E S K B D $ **)
- (** **)
- (******** Copyright (C) 1992 Centre d'Etudes de la Navigation Aerienne *******)
- (*****************************************************************************)
-
-
-
-
- (*
- * Titre: DEMO DES ROUTINES KBD$
- *
- * Sujet: Programme de demonstration des routines KBD$.
- *
- * Version: 1.0
- *
- * Description: Ce programme de demonstration met en oeuvre la fonction
- * KBD$READ_KEYSTROKE permettant d'attendre une action au
- * clavier et renvoyant la sequence ANSI correspondant a la
- * touche actionnee.
- *
- * Lorsque le tampon est plein, l'utilisateur est prevenu
- * par un beep sonore emit par le sous-programme d'IT.
- *
- * Afin de pouvoir recuperer les codes emis par CTRL/C,
- * CTRL/O, CTRL/Q, CTRL/S, CTRL/T, CTRL/X, CTRL/Y et F6, il est
- * necessaire d'entrer la commande DCL "SET TERMINAL/PASTHRU
- * /NOTTSYNC".
- *
- * Pour utiliser KBD$READ_KEYSTROKE, vous devez appeler au
- * prealable la fonction KBD$OPEN_KEYBOARD et terminer par
- * KBD$CLOSE_KEYBOARD.
- * La routine KBD$OPEN_KEYBOARD permet, entre autres, de ne
- * creer la zone tampon que si l'on desire reellement utiliser
- * KBD$READ_KEYSTROKE.
- *
- * Langage: PASCAL QUASI STANDARD
- *
- * Fichier: DEMO_PASCAL$KBD_ROUTINES.PAS
- *
- * Environnement: Machine cible: VAX
- * Systeme d'exploitation: VAX/VMS Version 5.4-3
- * Compilateur: VAX Pascal Version 4.3
- *
- * Auteur: Martin VICENTE (DGAC/CENA/SID)
- *
- * E-mail: vicente@cenaath.cena.dgac.fr
- *
- * Mail: C.E.N.A.
- * Div. Support Informatique & Developpement
- * Orly Sud 205
- * 94 542 ORLY AEROGARE CEDEX, FRANCE
- *
- * Creation: 19/05/92
- *
- * Modification: 26/05/92
- *
- *)
-
-
-
-
- [INHERIT( 'sys$library:pascal$lib_routines',
- 'vic$library:pascal$kbd_routines' )]
-
-
- PROGRAM demo_kbd$routines (output);
-
-
- PROCEDURE perform (cond_value : UNSIGNED);
-
- BEGIN
-
- IF NOT Odd (cond_value) THEN LIB$STOP (cond_value)
-
- END (* perform *);
-
-
- VAR
-
- yes : BOOLEAN;
- i : INTEGER;
- key : KBD$T_ANSI_SEQUENCE;
-
-
- BEGIN
-
- perform (KBD$OPEN_KEYBOARD);
-
- Writeln ('Press a key.');
-
- REPEAT
- perform (KBD$KEY_PRESSED (yes))
- UNTIL yes;
-
- Writeln ('Five loop...');
-
- FOR i := 1 TO 5 DO BEGIN
- Writeln ('Programme principal (loop): ', i:2);
- perform (LIB$WAIT (1))
- END {FOR};
-
- Writeln ('Five readkey...');
-
- FOR i := 1 TO 5 DO BEGIN
- Write ('Programme principal (SMG code): ');
- perform (KBD$READ_KEYSTROKE (key));
- Writeln (KBD$CVT_ANSI_SMG (key):5)
- END {FOR};
-
- Writeln ('Five loop...');
-
- FOR i := 1 TO 5 DO BEGIN
- Writeln ('Programme principal (loop): ', i:2);
- perform (LIB$WAIT (1))
- END {FOR};
-
- Writeln ('Flush keyboard.');
-
- perform (KBD$FLUSH_KEYBOARD);
-
- Writeln ('Five loop...');
-
- FOR i := 1 TO 5 DO BEGIN
- Writeln ('Programme principal (loop): ', i:2);
- perform (LIB$WAIT (1))
- END {FOR};
-
- Writeln ('End');
-
- perform (KBD$CLOSE_KEYBOARD)
-
- END (* DEMO PASCAL$KBD_ROUTINES *).
-