DEFINITION Key; (* SJ 15.5.93 *)

(* This module simplifies calling procedures if a certain key combination
   is pressed. You can assign a procedure to any key combination.
   A new list is used if a new task is initialized. The new list
   inherits the procedures of the previous task. The old list is used
   again if the task is terminated.
*)

CONST shift = 1; control = 2; alternate = 3;

(* these bits determine the shift bits of a special function key. There is
   no difference between right and left shift key.
*)

PROCEDURE Assign(Shift : SET; Scan : INTEGER; Proc : proc);

(* Sets the procedure to be called if a certain key is pressed. Only
   bits 1 to 3, i.e. left shift, control and alternate, are used. This
   is the way Event returns them.
*)   

PROCEDURE Call(Shift : SET; Scan : INTEGER) : BOOLEAN;

(* tests if the key combinatation defined by the shift status and the scan 
   code is assigned a procedure. This procedure is called and TRUE returned,
   else FALSE is returned. 
*)

END Key.