DEFINITION MODULE KeyMapD; (*$ Implementation:=FALSE *)
(* 17-Apr-1992/cn *)

FROM SYSTEM IMPORT ADDRESS,LONGSET;

FROM ExecD IMPORT Node,List;

CONST
(* Mögliche Resultatwerte der Funktionen MapANSI und MapRawKey *)
 badChar=0;
 buffOvfl=-1;
 internalErr=-2;

TYPE
 KeyMapTypes=(shift,alt,control,downup,kmp4,dead,string,nop);
 KeyMapTypeSet=SET OF KeyMapTypes;

CONST
 noQual=KeyMapTypeSet{};
 vanilla=KeyMapTypeSet{shift,alt,control};

TYPE
 DeadPrefixBytes=(dpbMod,dpb1,dpb2,dpbDead);
 DeadPrefixByteSet=SET OF DeadPrefixBytes;

CONST
 dp2dIndexMask=0FH;
 dp2dFacShift=4;

 maxKeys=64;

TYPE
 Types=ARRAY [0..maxKeys-1] OF KeyMapTypeSet;
 TypesPtr=POINTER TO Types;

 KeyInfo=RECORD
  CASE :INTEGER OF
  |0: ch:ARRAY [0..3] OF CHAR;
  |1: st:ADDRESS
  END
 END;

 Info=ARRAY [0..maxKeys-1] OF KeyInfo;
 InfoPtr=POINTER TO Info;

 BitTable=ARRAY [0..maxKeys DIV (8*SIZE(LONGSET))-1] OF LONGSET;
 BitTablePtr=POINTER TO BitTable;

 KeyMap=RECORD
  loKeyMapTypes:TypesPtr;
  loKeyMap:InfoPtr;
  loCapsable:BitTablePtr;
  loRepeatable:BitTablePtr;
  hiKeyMapTypes:TypesPtr;
  hiKeyMap:InfoPtr;
  hiCapsable:BitTablePtr;
  hiRepeatable:BitTablePtr;
 END;
 KeyMapPtr=POINTER TO KeyMap;

 KeyMapNode=RECORD
  node:Node;
  keyMap:KeyMap;
 END;

 KeyMapResource=RECORD
  node:Node;
  list:List;
 END;

END KeyMapD.noimp
