home *** CD-ROM | disk | FTP | other *** search
/ Global Amiga Experience / globalamigaexperience.iso / compressed / development / clusterdemo.dms / clusterdemo.adf / Modules.lha / modules / txt / Input.def < prev    next >
Text File  |  1994-05-25  |  4KB  |  155 lines

  1. |##########|
  2. |#MAGIC   #|CLABLJAP
  3. |#PROJECT #|"IMPORTALL"
  4. |#PATHS   #|"StdProject"
  5. |#FLAGS   #|xx---x-xx---xxx-----------------
  6. |#USERSW  #|--------------------------------
  7. |#USERMASK#|--------------------------------
  8. |#SWITCHES#|xx---xxxxx------
  9. |##########|
  10. DEFINITION MODULE Input;
  11.  
  12. (* $A- *)
  13.  
  14. FROM Resources IMPORT ContextPtr;
  15. FROM Timer     IMPORT TimeVal;
  16. FROM T_Exec    IMPORT nonstdVAL,IOCommand,IOStdReq;
  17.  
  18. TYPE
  19.   IOInputPtr    = POINTER TO IOInput;
  20.   IOInput       = RECORD OF IOStdReq END;
  21.  
  22.   ScreenPtr     = DEFERRED POINTER Intuition.ScreenPtr;
  23.  
  24.   Class         = (null,               rawkey,             rawmouse,
  25.            event,              pointerpos,         c15,
  26.            timer,              gadgetdown,         gadgetup,
  27.            requester,          menulist,           closewindow,
  28.            sizewindow,         refreshwindow,      newprefs,
  29.            diskremoved,        diskinserted,       activewindow,
  30.            inactivewindow,     newpointerpos,      menuhelp,
  31.            changewindow );
  32.  
  33.  
  34. CONST
  35.   classMax      = CARDINAL( Class'MAX );
  36.  
  37.  
  38. TYPE
  39.   SubClass      = (compatible,       pixel,              tablet );
  40.  
  41.   Coord         = RECORD
  42.             x, y : INTEGER;
  43.           END;
  44.  
  45.   | pointed to by InputEvent.eventAddress.
  46.   | the key is in InputEvent.subClass.
  47.   IEObjectPtr   = POINTER TO IEObject;
  48.   IEObject      = RECORD
  49.             IF KEY : SubClass
  50.             OF pixel THEN
  51.               screen    : ScreenPtr;
  52.               position  : Coord;
  53.             OF tablet THEN
  54.               range,
  55.               value     : Coord;
  56.               pressure  : INTEGER;
  57.             END
  58.           END;
  59.  
  60.  
  61. CONST
  62.   | rawkey
  63.   commCodeFirst = $78;
  64.   commCodeLast  = $7F;
  65.   keyCodeFirst  = $00;
  66.   keyCodeLast   = $77;
  67.   upPrefix      = $80;
  68.  
  69.   | ansi
  70.   asciiDel      = $7F;
  71.   asciiFirst    = $A0;
  72.   asciiLast     = $7E;
  73.   c0First       = $00;
  74.   c0Last        = $1F;
  75.   c1First       = $80;
  76.   c1Last        = $9F;
  77.   latin1First   = $A0;
  78.   latin1Last    = $FF;
  79.  
  80.   | rawmouse
  81.   lButton       = $68;
  82.   mButton       = $6A;
  83.   noButton      = $FF;
  84.   rButton       = $69;
  85.  
  86.   | event
  87.   newActive     = $01;
  88.   newSize       = $02;
  89.   refresh       = $03;
  90.  
  91.   | requester
  92.   reqClear      = $00;
  93.   reqSet        = $01;
  94.  
  95. TYPE
  96.   Qualifiers    = (lShift,             rShift,             capsLock,
  97.            control,            lAlt,               rAlt,
  98.            lCommand,           rCommand,           numericPad,
  99.            repeat,             interrupt,          multiBroadcast,
  100.            midButton,          rightButton,        leftButton,
  101.            relativeMouse );
  102.   QualifierSet  = SET OF Qualifiers;
  103.   KeyQualSet    = SET OF [lShift..rCommand];
  104.  
  105.   InputEventPtr = POINTER TO InputEvent;
  106.   InputEvent    = RECORD
  107.             nextEvent : InputEventPtr;
  108.             class     : Class;
  109.             subClass  : SubClass;
  110.             code      : CARDINAL;
  111.             qualifier : QualifierSet;
  112.             IF KEY : Class
  113.               OF newpointerpos THEN event         : IEObjectPtr;
  114.               OF rawkey        THEN prev1DownCode : SHORTCARD;
  115.                         prev1DownQual : KeyQualSet;
  116.                         prev2DownCode : SHORTCARD;
  117.                         prev2DownQual : KeyQualSet;
  118.               OF pointerpos    THEN x,y           : INTEGER
  119.             END;
  120.             timeStamp : TimeVal;
  121.           END;
  122.  
  123.  
  124. CONST
  125.   addHandler    = IOCommand( nonstdVAL + 0 );
  126.   remHandler    = IOCommand( nonstdVAL + 1 );
  127.   writeEvent    = IOCommand( nonstdVAL + 2 );
  128.   setTresh      = IOCommand( nonstdVAL + 3 );
  129.   setPeriod     = IOCommand( nonstdVAL + 4 );
  130.   setMPort      = IOCommand( nonstdVAL + 5 );
  131.   setMType      = IOCommand( nonstdVAL + 6 );
  132.   setMTrig      = IOCommand( nonstdVAL + 7 );
  133.  
  134.  
  135. PROCEDURE OpenInput( context : ContextPtr:=NIL ): IOInputPtr;
  136.  
  137. PROCEDURE CloseInput( VAR request : IOInputPtr );
  138.  
  139.  
  140. GROUP
  141.   EventGrp      = Class,             classMax,            SubClass,
  142.           Qualifiers,        QualifierSet,        IEObject,
  143.           IEObjectPtr,       InputEventPtr,       InputEvent;
  144.  
  145.   CommandGrp    = addHandler,         remHandler,         writeEvent,
  146.           setTresh,           setPeriod,          setMPort,
  147.           setMType,           setMTrig;
  148.  
  149.   FuncGrp       = IOInputPtr,         OpenInput,          CloseInput;
  150.  
  151.   All           = CommandGrp,         FuncGrp,            T_Exec.ExecIOGrp,
  152.           EventGrp;
  153.  
  154. END Input.
  155.