home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
modula2
/
library
/
modula2
/
pckeys.mod
< prev
next >
Wrap
Text File
|
1987-07-14
|
4KB
|
152 lines
IMPLEMENTATION MODULE PcKeys;
(**********************************************************)
(* ROLLINS MEDICAL/DENTAL SYSTEMS *)
(* 360 CLAUSEN BUILDING *)
(* 23100 PROVIDENCE DRIVE *)
(* SOUTHFIELD, MI 48075-3677 *)
(* ------------------------------------------------- *)
(* | | *)
(* | Key Defs for Pc | *)
(* | | *)
(* ------------------------------------------------- *)
(* Author: John Tal Created: 04/22/1986 *)
(* Version: 2.00 a Last Edit: 04/26/1986 *)
(* *)
(* (C) Copyright 1986 ROLLINS MEDICAL/DENTAL SYSTEMS *)
(* All Rights Reserved *)
(* *)
(* Permission is hereby granted to use and modify the *)
(* following module in the implementation of customized *)
(* software. *)
(* This permission includes the right to re-distribute *)
(* the original source code but does not include the *)
(* right to redistribute modified source code of this *)
(* program. *)
(**********************************************************)
FROM SYSTEM IMPORT DOSCALL,BYTE;
FROM Keyboard IMPORT KeyPressed;
PROCEDURE MakeSpecial(b: CHAR; VAR c: ARRAY OF CHAR);
BEGIN
c[0] := CHR(0);
c[1] := b;
END MakeSpecial;
PROCEDURE CompareKey(keysA,keysB: ARRAY OF CHAR) : BOOLEAN;
BEGIN
IF ORD(keysA[0]) = 0 THEN
IF ORD(keysA[0]) = ORD(keysB[0]) THEN
IF ORD(keysA[1]) = ORD(keysB[1]) THEN
RETURN TRUE;
ELSE
RETURN FALSE;
END;
ELSE
RETURN FALSE;
END;
ELSE
IF ORD(keysA[0]) = ORD(keysB[0]) THEN
RETURN TRUE;
ELSE
RETURN FALSE;
END;
END;
END CompareKey;
PROCEDURE InKey(VAR keys: ARRAY OF CHAR) : BOOLEAN;
VAR
keyfetch : BYTE;
BEGIN
IF KeyPressed() THEN
DOSCALL(8H,keyfetch);
IF ORD(keyfetch) = 0 THEN
DOSCALL(8H,keyfetch);
keys[0] := CHR(0);
keys[1] := CHR(ORD(keyfetch));
RETURN(TRUE);
ELSE
keys[0] := CHR(ORD(keyfetch));
keys[1] := CHR(0);
RETURN(TRUE);
END
ELSE
RETURN(FALSE);
END;
END InKey;
PROCEDURE SpecialKey(keys: ARRAY OF CHAR) : BOOLEAN;
BEGIN
IF ORD(keys[0]) = 0 THEN
RETURN TRUE;
ELSE
RETURN FALSE;
END;
END SpecialKey;
BEGIN
CarriageReturn := CHR(13);
BackSpace := CHR(8);
Tab := CHR(9);
Escape := CHR(27);
MakeSpecial(CHR(71),Home);
MakeSpecial(CHR(72),UpArrow);
MakeSpecial(CHR(73),PageUp);
MakeSpecial(CHR(75),LtArrow);
MakeSpecial(CHR(77),RtArrow);
MakeSpecial(CHR(79),End);
MakeSpecial(CHR(80),DnArrow);
MakeSpecial(CHR(81),PageDn);
MakeSpecial(CHR(82),Insert);
MakeSpecial(CHR(83),Delete);
MakeSpecial(CHR(15),ShiftTab);
MakeSpecial(CHR(59),F1);
MakeSpecial(CHR(60),F2);
MakeSpecial(CHR(61),F3);
MakeSpecial(CHR(62),F4);
MakeSpecial(CHR(63),F5);
MakeSpecial(CHR(64),F6);
MakeSpecial(CHR(65),F7);
MakeSpecial(CHR(66),F8);
MakeSpecial(CHR(67),F9);
MakeSpecial(CHR(68),F10);
MakeSpecial(CHR(84),ShF1);
MakeSpecial(CHR(85),ShF2);
MakeSpecial(CHR(86),ShF3);
MakeSpecial(CHR(87),ShF4);
MakeSpecial(CHR(88),ShF5);
MakeSpecial(CHR(89),ShF6);
MakeSpecial(CHR(90),ShF7);
MakeSpecial(CHR(91),ShF8);
MakeSpecial(CHR(92),ShF9);
MakeSpecial(CHR(93),ShF10);
MakeSpecial(CHR(94),CtF1);
MakeSpecial(CHR(95),CtF2);
MakeSpecial(CHR(96),CtF3);
MakeSpecial(CHR(97),CtF4);
MakeSpecial(CHR(98),CtF5);
MakeSpecial(CHR(99),CtF6);
MakeSpecial(CHR(100),CtF7);
MakeSpecial(CHR(101),CtF8);
MakeSpecial(CHR(102),CtF9);
MakeSpecial(CHR(103),CtF10);
MakeSpecial(CHR(104),AtF1);
MakeSpecial(CHR(105),AtF2);
MakeSpecial(CHR(106),AtF3);
MakeSpecial(CHR(107),AtF4);
MakeSpecial(CHR(108),AtF5);
MakeSpecial(CHR(109),AtF6);
MakeSpecial(CHR(110),AtF7);
MakeSpecial(CHR(111),AtF8);
MakeSpecial(CHR(112),AtF9);
MakeSpecial(CHR(113),AtF10);
END PcKeys.