home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / languages / obrn-a_1.5_lib.lha / oberon-a / source1.lha / source / amiga / InputEvent.mod < prev    next >
Encoding:
Text File  |  1995-01-26  |  10.1 KB  |  292 lines

  1. (**************************************************************************
  2.  
  3.      $RCSfile: InputEvent.mod $
  4.   Description: input event definitions
  5.  
  6.    Created by: fjc (Frank Copeland)
  7.     $Revision: 3.7 $
  8.       $Author: fjc $
  9.         $Date: 1995/01/26 02:39:55 $
  10.  
  11.   $VER: inputevent.h 36.10 (26.6.92)
  12.   Includes Release 40.15
  13.  
  14.   (C) Copyright 1985-1993 Commodore-Amiga, Inc.
  15.       All Rights Reserved
  16.  
  17.   Oberon-A interface Copyright © 1994-1995, Frank Copeland.
  18.   This file is part of the Oberon-A Interface.
  19.   See Oberon-A.doc for conditions of use and distribution.
  20.  
  21. ***************************************************************************)
  22.  
  23. <* STANDARD- *> <* INITIALISE- *> <* MAIN- *>
  24. <*$ CaseChk-  IndexChk- LongVars+ NilChk-  *>
  25. <*$ RangeChk- StackChk- TypeChk-  OvflChk- *>
  26.  
  27. MODULE [2] InputEvent;
  28.  
  29. IMPORT e := Exec, u := Utility, t := Timer, g := Graphics, s := Sets;
  30.  
  31.  
  32. (* ----- constants --------------------------------------------------*)
  33.  
  34. CONST
  35.  
  36. (*  --- InputEvent.ieClass --- *)
  37. (* A NOP input event *)
  38.   null *                  = 00H;
  39. (* A raw keycode from the keyboard device *)
  40.   rawkey *                = 01H;
  41. (* The raw mouse report from the game port device *)
  42.   rawmouse *              = 02H;
  43. (* A private console event *)
  44.   event *                 = 03H;
  45. (* A Pointer Position report *)
  46.   pointerpos *            = 04H;
  47. (* A timer event *)
  48.   timer *                 = 06H;
  49. (* select button pressed down over a Gadget (address in ieEventAddress) *)
  50.   gadgetdown *            = 07H;
  51. (* select button released over the same Gadget (address in ieEventAddress) *)
  52.   gadgetup *              = 08H;
  53. (* some Requester activity has taken place.  See Codes REQCLEAR and REQSET *)
  54.   requester *             = 09H;
  55. (* this is a Menu Number transmission (Menu number is in ieCode) *)
  56.   menulist *              = 0AH;
  57. (* User has selected the active Window's Close Gadget *)
  58.   closewindow *           = 0BH;
  59. (* this Window has a new size *)
  60.   sizewindow *            = 0CH;
  61. (* the Window pointed to by ieEventAddress needs to be refreshed *)
  62.   refreshwindow *         = 0DH;
  63. (* new preferences are available *)
  64.   newprefs *              = 0EH;
  65. (* the disk has been removed *)
  66.   diskremoved *           = 0FH;
  67. (* the disk has been inserted *)
  68.   diskinserted *          = 10H;
  69. (* the window is about to be been made active *)
  70.   activewindow *          = 11H;
  71. (* the window is about to be made inactive *)
  72.   inactivewindow *        = 12H;
  73. (* extended-function pointer position report (V36) *)
  74.   newpointerpos *         = 13H;
  75. (* Help key report during Menu session (V36) *)
  76.   menuhelp *              = 14H;
  77. (* the Window has been modified with move, size, zoom, or change (V36) *)
  78.   changewindow *          = 15H;
  79.  
  80. (* the last class *)
  81.   classMax *              = 15H;
  82.  
  83.  
  84. (*  --- InputEvent.ieSubClass --- *)
  85. (*  NewPointerPos *)
  86. (*      like PointerPos *)
  87.   compatible * = 00H;
  88. (*      InputEvent.eventAddress points to PointerPixel) *)
  89.   pixel *      = 01H;
  90. (*      InputEvent.eventAddress points to PointerTablet) *)
  91.   tablet *     = 02H;
  92. (*      InputEvent.eventAddress points to NewTablet *)
  93.   newTablet *  = 03H;
  94.  
  95. TYPE
  96.  
  97.   IEDummyPtr * = POINTER TO IEDummy;
  98.   IEDummy * = RECORD END;
  99.  
  100. (* pointed to by InputEvent.eventAddress for classNewPointerPos,
  101.  * and subClassPixel.
  102.  *
  103.  * You specify a screen and pixel coordinates in that screen
  104.  * at which you'd like the mouse to be positioned.
  105.  * Intuition will try to oblige, but there will be restrictions
  106.  * to positioning the pointer over offscreen pixels.
  107.  *
  108.  * qualRelativeMouse is supported for subClassPixel.
  109.  *)
  110.  
  111.   PointerPixelPtr* = POINTER TO PointerPixel;
  112.   PointerPixel* = RECORD (IEDummy)
  113.     screen* : e.APTR;    (* Intuition.ScreenPtr *)
  114.                          (* pointer to an open screen *)
  115.     position* : g.Point; (* pixel coordinates in screen *)
  116.   END; (* PointerPixel *)
  117.  
  118. (* pointed to by InputEvent.eventAddress for classNewPointerPos,
  119.  * and subClassTablet.
  120.  *
  121.  * You specify a range of values and a value within the range
  122.  * independently for each of X and Y (the minimum value of
  123.  * the ranges is always normalized to 0).
  124.  *
  125.  * Intuition will position the mouse proportionally within its
  126.  * natural mouse position rectangle limits.
  127.  *
  128.  * qualRelativeMouse is not supported for subClassTablet.
  129.  *)
  130.  
  131.   PointerTabletPtr* = POINTER TO PointerTablet;
  132.   PointerTablet* = RECORD (IEDummy)
  133.     range * : g.Point;    (* 0 is min, these are max *)
  134.     value * : g.Point;    (* between 0 and Range *)
  135.     pressure * :INTEGER;  (* -128 to 127 (unused, set to 0) *)
  136.   END; (* PointerTablet *)
  137.  
  138.  
  139. (* The InputEvent.eventAddress of an classNewPointerPos event of subclass
  140.  * subClassNewTablet points at a NewTablet structure.
  141.  *
  142.  *
  143.  * qualRelativeMouse is not supported for subClassNewTablet.
  144.  *)
  145.  
  146.   NewTabletPtr * = POINTER TO NewTablet;
  147.   NewTablet * = RECORD (IEDummy)
  148.     (* Pointer to a hook you wish to be called back through, in
  149.      * order to handle scaling.  You will be provided with the
  150.      * width and height you are expected to scale your tablet
  151.      * to, perhaps based on some user preferences.
  152.      * If NULL, the tablet's specified range will be mapped directly
  153.      * to that width and height for you, and you will not be
  154.      * called back.
  155.      *)
  156.     callBack * :  u.HookPtr;
  157.  
  158.     (* Post-scaling coordinates and fractional coordinates.
  159.      * DO NOT FILL THESE IN AT THE TIME THE EVENT IS WRITTEN!
  160.      * Your driver will be called back and provided information
  161.      * about the width and height of the area to scale the
  162.      * tablet into.  It should scale the tablet coordinates
  163.      * (perhaps based on some preferences controlling aspect
  164.      * ratio, etc.) and place the scaled result into these
  165.      * fields.  The ient_ScaledX and ient_ScaledY fields are
  166.      * in screen-pixel resolution, but the origin ( [0,0]-point )
  167.      * is not defined.  The ient_ScaledXFraction and
  168.      * ient_ScaledYFraction fields represent sub-pixel position
  169.      * information, and should be scaled to fill a UWORD fraction.
  170.      *)
  171.     scaledX *, scaledY * : e.UWORD;
  172.     scaledXFraction *, scaledYFraction * :  e.UWORD;
  173.  
  174.     (* Current tablet coordinates along each axis: *)
  175.     tabletX *, tabletY * :  e.ULONG;
  176.  
  177.     (* Tablet range along each axis.  For example, if ient_TabletX
  178.      * can take values 0-999, ient_RangeX should be 1000.
  179.      *)
  180.     rangeX *, rangeY * :  e.ULONG;
  181.  
  182.     (* Pointer to tag-list of additional tablet attributes.
  183.      * See <intuition/intuition.h> for the tag values.
  184.      *)
  185.     tagList * : u.TagListPtr;
  186.   END;
  187.  
  188. CONST
  189.  
  190. (*  --- InputEvent.ieCode --- *)
  191. (*  rawKey *)
  192.   upPrefix *             = 80H;
  193.   keyCodeFirst *         = 00H;
  194.   keyCodeLast *          = 77H;
  195.   commCodeFirst *        = 78H;
  196.   commCodeLast *         = 7FH;
  197.  
  198. (*  ANSI *)
  199.   c0First *              = 00H;
  200.   c0Last *               = 1FH;
  201.   asciiFirst *           = 20H;
  202.   asciiLast *            = 7EH;
  203.   asciiDel *             = 7FH;
  204.   c1First *              = 80H;
  205.   c1Last *               = 9FH;
  206.   latin1First *          = 0A0H;
  207.   latin1Last *           = 0FFH;
  208.  
  209. (*  RawMouse *)
  210.   lButton *              = 68H;    (* also uses UpPREFIX *)
  211.   rButton *              = 69H;
  212.   mButton *              = 6AH;
  213.   noButton *             = 0FFH;
  214.  
  215. (*  Event (V36) *)
  216.   newActive *            = 01H;    (* new active input window *)
  217.   newSize *              = 02H;    (* resize of window *)
  218.   refresh *              = 03H;    (* refresh of window *)
  219.  
  220. (*  Requester *)
  221. (*      broadcast when the first Requester (not subsequent ones) opens up in *)
  222. (*      the Window *)
  223.   reqSet *               = 01H;
  224. (*      broadcast when the last Requester clears out of the Window *)
  225.   reqClear *             = 00H;
  226.  
  227.  
  228.  
  229. (*  --- InputEvent.ieQualifier --- *)
  230.   lShift *           = 0;
  231.   rShift *           = 1;
  232.   capsLock *         = 2;
  233.   control *          = 3;
  234.   lAlt *             = 4;
  235.   rAlt *             = 5;
  236.   lCommand *         = 6;
  237.   rCommand *         = 7;
  238.   numericPad *       = 8;
  239.   repeat *           = 9;
  240.   interrupt *        = 10;
  241.   multiBroadcast *   = 11;
  242.   midButton *        = 12;
  243.   rightButton *      = 13;
  244.   leftButton *       = 14;
  245.   relativeMouse *    = 15;
  246.  
  247. (* ----- InputEvent -------------------------------------------------*)
  248.  
  249. TYPE
  250.  
  251.   InputEventDummyPtr* = POINTER TO InputEventDummy;
  252.   InputEventDummy* = RECORD END;
  253.  
  254.   InputEventPtr* = POINTER TO InputEvent;
  255.   InputEvent* = RECORD (InputEventDummy)
  256.     nextEvent*  : InputEventDummyPtr; (* the chronologically next event *)
  257.     class *     : SHORTINT;  (* the input event class *)
  258.     subClass *  : SHORTINT;  (* optional subclass of the class *)
  259.     code *      : e.UWORD;   (* the input event code *)
  260.     qualifier*  : s.SET16;   (* qualifiers in effect for the event*)
  261.     x *         : INTEGER;   (* the pointer position for the event*)
  262.     y *         : INTEGER;
  263.     timeStamp * : t.TimeVal; (* the system tick at the event *)
  264.   END; (* InputEvent *)
  265.  
  266.   InputEventAdrPtr* = POINTER TO InputEventAdr;
  267.   InputEventAdr* = RECORD (InputEventDummy)
  268.     nextEvent*  : InputEventDummyPtr; (* the chronologically next event *)
  269.     class *     : SHORTINT;   (* the input event class *)
  270.     subClass *  : SHORTINT;   (* optional subclass of the class *)
  271.     code *      : e.UWORD;    (* the input event code *)
  272.     qualifier*  : s.SET16;    (* qualifiers in effect for the event*)
  273.     addr *      : IEDummyPtr;  (* the event address *)
  274.     TimeStamp * : t.TimeVal;  (* the system tick at the event *)
  275.   END; (* InputEventAdr *)
  276.  
  277.   InputEventPrevPtr* = POINTER TO InputEventPrev;
  278.   InputEventPrev* = RECORD (InputEventDummy)
  279.     nextEvent*      : InputEventDummyPtr; (* the chronologically next event *)
  280.     class *         : SHORTINT;   (* the input event class *)
  281.     subClass *      : SHORTINT;   (* optional subclass of the class *)
  282.     code *          : e.UWORD;    (* the input event code *)
  283.     qualifier*      : s.SET16;    (* qualifiers in effect for the event*)
  284.     prev1DownCode * : SHORTINT;   (* previous down keys for dead *)
  285.     prev1DownQual * : s.SET8;     (*   key translation: the ieCode *)
  286.     prev2DownCode * : SHORTINT;   (*   & low byte of ieQualifier for *)
  287.     prev2DownQual * : s.SET8;     (*   last & second last down keys *)
  288.     timeStamp *     : t.TimeVal;  (* the system tick at the event *)
  289.   END; (* InputEventPrev *)
  290.  
  291. END InputEvent.
  292.