(*$M-*)
DEFINITION MODULE InputEvent;

FROM SYSTEM IMPORT
 ADDRESS;
FROM Timer IMPORT
 TimeVal;

TYPE
 Class=(
  null,rawkey,rawmouse,event,pointerpos,cl5,timer,gadgetdown,
  gadgetup,requester,menulist,closewindow,sizewindow,
  refreshwindow,newprefs,diskremoved,diskinserted,
  activewindow,inactivewindow
 );

CONST
 classMax=ORD(MAX(Class));
 upPrefix=080H;
 keyCodeFirst=00H;
 keyCodeLast=077H;
 commCodeFirst=078H;
 commCodeLast=07FH;
 c0First=00H;
 c0Last=01FH;
 asciiFirst=020H;
 asciiLast=07EH;
 asciiDel=07FH;
 c1First=080H;
 c1Last=09FH;
 latin1First=0A0H;
 latin1Last=0FFH;
 lButton=068H;
 rButton=069H;
 mButton=06AH;
 noButton=0FFH;
 newActive=01H;
 reqClear=00H;
 reqSet=01H;

TYPE
 Qualifiers=(
  lShift,rShift,capsLock,control,lAlt,rAlt,lCommand,rCommand,
  numericPad,repeat,interrupt,multiBroadcast,midButton,
  rightButton,leftButton,relativeMouse
 );
 QualifierSet=SET OF Qualifiers;
 InputEventPtr=POINTER TO InputEvent;
 InputEvent=RECORD
  nextEvent:InputEventPtr;
  class:Class;
  subClass:Class;
  code:CARDINAL;
  qualifier:QualifierSet;
  CASE :INTEGER OF
  |0: x,y:INTEGER;
  |1: eventAddress:ADDRESS
  END;
  timeStamp:TimeVal
 END;

END InputEvent.
