home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Interactive Reference Guide / C-C++ Interactive Reference Guide.iso / c_ref / csource5 / 321_01 / moustrap.prn < prev    next >
Encoding:
Text File  |  1990-08-06  |  77.2 KB  |  2,704 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.                   
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.                                                             The MouseTrap Library
  37.                                                           
  38.                                                    High & Low Level Mouse Control
  39.                                                        Functions for 'C' Programs
  40.                                                                       Version 1.1
  41.                                                            
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.                                                                By James M. Curran 
  56.                                                             By James M. Curran.
  57.                                                                 24 Greendale Road
  58.                                                                   Cedar Grove, NJ
  59.                                                                        07009-1313
  60.  
  61.  
  62.  
  63.  
  64.  
  65.                                      Table of Contents
  66.  
  67.           1.   Introduction  . . . . . . . . . . . . . . . . . . . . . . . .    3
  68.                Registration  . . . . . . . . . . . . . . . . . . . . . . . .    3
  69.                Warranty  . . . . . . . . . . . . . . . . . . . . . . . . . .    3
  70.  
  71.           2. Basic Mouse Control Functions . . . . . . . . . . . . . . . . .    4
  72.                Check_Mouse . . . . . . . . . . . . . . . . . . . . . . . . .    5
  73.                Show_Mouse  . . . . . . . . . . . . . . . . . . . . . . . . .    6
  74.                Hide_Mouse  . . . . . . . . . . . . . . . . . . . . . . . . .    6
  75.                Get_Mouse_Position  . . . . . . . . . . . . . . . . . . . . .    7
  76.                Set_Mouse_Position  . . . . . . . . . . . . . . . . . . . . .    9
  77.                Get_Mouse_Press . . . . . . . . . . . . . . . . . . . . . . .   10
  78.                Get_Mouse_Release . . . . . . . . . . . . . . . . . . . . . .   10
  79.                Set_Mouse_Limit . . . . . . . . . . . . . . . . . . . . . . .   11
  80.                Set_Mouse_Limit_Horiz . . . . . . . . . . . . . . . . . . . .   11
  81.                Set_Mouse_Limit_Vert  . . . . . . . . . . . . . . . . . . . .   11
  82.                Set_Mouse_Region  . . . . . . . . . . . . . . . . . . . . . .   11
  83.                Set_Mouse_Text_Cursor . . . . . . . . . . . . . . . . . . . .   12
  84.                Set_Mouse_Graphic_Cursor  . . . . . . . . . . . . . . . . . .   13
  85.  
  86.           3. Advanced Mouse Control Functions  . . . . . . . . . . . . . . .   16
  87.                Activate_Mouse_Page . . . . . . . . . . . . . . . . . . . . .   17
  88.                Add_Mouse_Page  . . . . . . . . . . . . . . . . . . . . . . .   18
  89.                Add_Mouse_Button  . . . . . . . . . . . . . . . . . . . . . .   19
  90.                Add_Mouse_Hot_Spot  . . . . . . . . . . . . . . . . . . . . .   20
  91.                Clear_All_Mouse_Definitions . . . . . . . . . . . . . . . . .   21
  92.                Clear_Mouse_Pages . . . . . . . . . . . . . . . . . . . . . .   22
  93.                DeActivate_Mouse_Page . . . . . . . . . . . . . . . . . . . .   23
  94.                Define_Mouse_System . . . . . . . . . . . . . . . . . . . . .   24
  95.                Delete_Mouse_Button . . . . . . . . . . . . . . . . . . . . .   25
  96.                Delete_Mouse_Hot_Spot . . . . . . . . . . . . . . . . . . . .   25
  97.                Delete_Mouse_Page . . . . . . . . . . . . . . . . . . . . . .   25
  98.                Get_Char_Mouse_Kbd  . . . . . . . . . . . . . . . . . . . . .   26
  99.                Read_Mouse  . . . . . . . . . . . . . . . . . . . . . . . . .   27
  100.                Read_Mouse_Kbd  . . . . . . . . . . . . . . . . . . . . . . .   28
  101.  
  102.           4.   Using the MouseTrap Library . . . . . . . . . . . . . . . . .   29
  103.  
  104.           5.   Technical Specification . . . . . . . . . . . . . . . . . . .   35
  105.  
  106.           Appendix . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   36
  107.                MOUSTRAP.H  . . . . . . . . . . . . . . . . . . . . . . . . .   37
  108.                Global Variables  . . . . . . . . . . . . . . . . . . . . . .   38
  109.                Error Codes.  . . . . . . . . . . . . . . . . . . . . . . . .   39
  110.                Reference . . . . . . . . . . . . . . . . . . . . . . . . . .   41
  111.                Support . . . . . . . . . . . . . . . . . . . . . . . . . . .   42
  112.                Revision History  . . . . . . . . . . . . . . . . . . . . . .   43
  113.                Index . . . . . . . . . . . . . . . . . . . . . . . . . . . .   44
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.                                                       MouseTrap Library, Rel 1.01
  121.                                                                 February 12, 1989
  122.  
  123.                        Introduction
  124.  
  125.                        The  MouseTrap  library is a collection of  functions  to 
  126.                control a mouse, designed to be called from a 'C' program.   They 
  127.                provide  easy  access  to the low-level functions  of  the  mouse 
  128.                interrupt,  as well as a simplified system for high-level control 
  129.                over  the mouse.  The basic functions are mostly self explanatory 
  130.                and  are described in chapter 2 of the document.   The high-level 
  131.                functions  are  a  bit more complicated.  They are  described  in 
  132.                Chapter 3 with a tutorial in Chapter 4.
  133.  
  134.  
  135.                        Registration
  136.  
  137.                     The  MouseTrap  Library is copyrighted by James  M.  Curran. 
  138.                 You  are  granted  a  limited  license  to  use  MouseTrap,   for 
  139.                noncommercial programs.  You may, and are in fact encouraged,  to 
  140.                copy  and distribute it,  provided that the following  conditions 
  141.                are met:  (a)  No fee may be charged for copying or distributing, 
  142.                and  (b)   only  the  library  files  (*.LIB)   and  accompanying 
  143.                documentation   are  distributed,   and only in  their  original, 
  144.                unmodified form.
  145.  
  146.                     Sending a voluntary contribution of $15.00 will appease your 
  147.                guilt, and earn you my undying gratitude.  It will also get you a 
  148.                copy  of  the source code,  the  Compact  (CMOUSE.LIB)  &  Medium 
  149.                (MMOUSE.LIB)  memory  model libraries,  the missing chapter  from 
  150.                this booklet, and other assorted related files.   Microsoft C 5.1 
  151.                &  MASM  5.1  are needed to recompile the source  files,  (unless 
  152.                modified by the user).  
  153.  
  154.                     Contributions,  (and  requests for information on commercial 
  155.                licenses) should be sent to:
  156.                                         James M. Curran
  157.                                         24 Greendale Road
  158.                                         Cedar Grove, NJ 07009-1313
  159.  
  160.                     Finally, there's only one thing you can say for sure about a 
  161.                "Version  1.0"  release  of  software---  That it  will  soon  be 
  162.                followed by a "Version 1.01" Bug-Fix release.  So, all registered 
  163.                user  will be sent that version when it's ready.   (That's merely 
  164.                cautionary; there are no known bugs at this time).
  165.  
  166.                        Warranty
  167.  
  168.                     Warranty  ?   We make no promises that the MouseTrap library 
  169.                will do anything useful for you.  Nor do we promise that it WON'T 
  170.                do  anything  harmful.   (Life's  Tough;  "Want do you  want  for 
  171.                nothing ? Rubber Biscuit ?")
  172.  
  173.                                         - Page 3 -
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.                                                       MouseTrap Library, Rel 1.01
  181.                                                                 February 12, 1989
  182.  
  183.  
  184.                               Chapter 2: 
  185.  
  186.                                    Basic Mouse Control Functions
  187.  
  188.  
  189.                     The  eleven  primitives that make up the  low-level  support 
  190.                functions  are almost direct calls to the mouse driver interrupt, 
  191.                and are written in 8086 assembler.   They were originally derived 
  192.                from  a  set  of 'C'  functions given in an article in  "The  'C' 
  193.                Gazette"  (see  references  at  end),  but  since  then  numerous 
  194.                revisions  have  transformed them.   The only thing left  are  the 
  195.                names of two functions.
  196.  
  197.                     Check_Mouse()            Get_Mouse_Press()
  198.                     Show_Mouse()             Get_Mouse_Release()
  199.                     Hide_Mouse()             Set_Mouse_Text_Cursor()
  200.                     Get_Mouse_Position()     
  201.                     Set_Mouse_Position()     
  202.                     Set_Mouse_Limits()  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.                                         - Page 4 -
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.                                                       MouseTrap Library, Rel 1.01
  241.                                                                 February 12, 1989
  242.  
  243.  
  244.                     Check_Mouse - Check for the existence and type of Mouse.
  245.  
  246.                Syntax:
  247.                     #include <moustrap.h> 
  248.                                  
  249.                     mouse_t Check_Mouse(void);
  250.  
  251.                Description:
  252.                     This  function initialized the mouse interrupt  driver,  and 
  253.                must   be   the   first  low-level  function  called   (but   see 
  254.                Define_Mouse_System()).  It  checks to  see if a mouse is attached 
  255.                (or to be exact, if a mouse device driver is loaded into memory), 
  256.                and if one is present, determines how many buttons it has.   This 
  257.                information is return by the function,  and is also stored in the 
  258.                global variable "_mouse_there".
  259.  
  260.                Returns Value:
  261.                     If no mouse is detected, the Check_Mouse function returns 0. 
  262.                If a mouse IS detected,  the number of buttons on it is returned. 
  263.                These values are also stored in the global _mouse_there. This can 
  264.                also be used as a TRUE/FALSE indicator.
  265.  
  266.                See Also:
  267.                     Define_Mouse_System, _mouse_there
  268.  
  269.                Example:
  270.                  #include <moustrap.h>
  271.                  #include <stdio.h>
  272.                  main()
  273.                  {
  274.                    Check_Mouse();
  275.                    if (_mouse_there) 
  276.                        printf("A %d-button Mouse was detected.\n",_mouse_there);
  277.                     else
  278.                        printf("No mouse was found.\n");
  279.                   }
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.                                         - Page 5 -
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.                                                       MouseTrap Library, Rel 1.01
  301.                                                                 February 12, 1989
  302.  
  303.                     Show_Mouse - Display Mouse Cursor.
  304.                     Hide_Mouse - Hide Mouse Cursor.
  305.  
  306.                Syntax:
  307.                     #include <moustrap.h> 
  308.                                  
  309.                     void Show_Mouse(void);
  310.                     void Hide_Mouse(void);
  311.  
  312.                Description:
  313.                     Show_Mouse  causes  the mouse cursor to be displayed on  the
  314.                     screen. Hide_Mouse cause the mouse cursor to disappear.
  315.                     Neither will have any effect if there is no mouse or
  316.                     Check_Mouse has not been executed yet.
  317.                   
  318.                Returns Value:
  319.                     There is no return value.
  320.  
  321.                See Also:
  322.                     Check_Mouse, _mouse_there
  323.  
  324.                Example:
  325.                  #include <moustrap.h>
  326.                  #include <stdio.h>
  327.                  main()
  328.                  {
  329.                    Check_Mouse();
  330.  
  331.                     Show_Mouse();
  332.                     printf("Look, Ma!  A mouse !");
  333.                     getch();       /* Mouse visible until a key is pressed */    
  334.                     Hide_Mouse(); 
  335.                   }
  336.  
  337.  
  338.  
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.                                         - Page 6 -
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.                                                       MouseTrap Library, Rel 1.01
  361.                                                                 February 12, 1989
  362.  
  363.  
  364.                        Get_Mouse_Position   
  365.  
  366.                Syntax:
  367.                        #include <moustrap.h>
  368.                        mouse_t Get_Mouse_Position(mouse_t *X, mouse_t *Y);
  369.  
  370.                Description:
  371.                     Get_Mouse_Position  places the X (Horizontal) and Y
  372.                     (Vertical) coordinates of the present location of the mouse
  373.                     cursor into the locations given by X & Y.  The locations are
  374.                     given using graphic coordinates in the range (0,0) to
  375.                     (639,199).  It also returns the binary sum of the buttons
  376.                     pressed.  If _mouse_there indicates that no mouse was
  377.                     detected, the values of X &  Y are left unchanged, and the
  378.                     function returns 0.
  379.  
  380.                Return Value:
  381.                     The binary sum of the buttons pressed, where the Left button 
  382.                     equals  1,  the  Right button equals 2,  and the Middle  
  383.                     button, 4. These  values are added together if more than one 
  384.                     button is  pressed.  For  example,  pressing  the  Left  &   
  385.                     Middle buttons would have Get_Mouse_Position return a value 
  386.                     of 5.
  387.  
  388.                See Also:
  389.                        _mouse_there, Set_Mouse_Position
  390.  
  391.                Example:
  392.                        #include <moustrap.h>
  393.                        #include <stdio.h>
  394.                        main()
  395.                        {
  396.                            int     X,Y,m;
  397.                                
  398.                            Check_Mouse();
  399.                            do {
  400.                                   m = Get_Mouse_Position( &X, &Y);
  401.                                   if (m & 1)
  402.                                          printf("Left Button, ");
  403.  
  404.                                   if (m & 2)
  405.                                          printf("Right Button, ");
  406.  
  407.                                   if (m & 4)
  408.                                          printf("Middle Button, ");
  409.                                   if (m)
  410.                                          printf("pressed at (%d, %d)\n",X,Y);
  411.  
  412.  
  413.                                         - Page 7 -
  414.  
  415.  
  416.  
  417.  
  418.  
  419.  
  420.                                                       MouseTrap Library, Rel 1.01
  421.                                                                 February 12, 1989
  422.  
  423.                               } while (m==0);
  424.                        }
  425.                        Pressing the Left & Right buttons would print something   
  426.             similar to:
  427.                        Left Button, Right Button pressed at (120, 85)
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.  
  470.  
  471.  
  472.  
  473.                                         - Page 8 -
  474.  
  475.  
  476.  
  477.  
  478.  
  479.  
  480.                                                       MouseTrap Library, Rel 1.01
  481.                                                                 February 12, 1989
  482.  
  483.                        Set_Mouse_Position
  484.  
  485.                Syntax:
  486.                     #include <moustrap.h>
  487.  
  488.                     void Set_Mouse_Position(mouse_t X, mouse_t Y);
  489.  
  490.  
  491.                Description:
  492.                     The function Set_Mouse_Position moves the mouse cursor to   
  493.                     the screen location given by the graphic coordinates (X,Y).
  494.                     X must be in the range (0-639) and Y in the range (0-199).
  495.  
  496.                Return Value:
  497.                     None.
  498.  
  499.                See Also:
  500.                     Get_Mouse_Position
  501.  
  502.                Example:
  503.                     #include <moustrap.h>
  504.                     #include <stdio.h>
  505.  
  506.                      main()
  507.                      {
  508.                          int     X,Y,m;
  509.                                
  510.                          Check_Mouse();
  511.  
  512.                          Show_Mouse();
  513.                          Get_Mouse_Position( &X, &Y);
  514.  
  515.                          X++;
  516.                          Y--;
  517.  
  518.                          Set_Mouse_Position(  X,  Y);
  519.  
  520.                      }
  521.  
  522.                     The above program would move the mouse cursor, "Up" and to  
  523.                     the "Right", without the mouse physically being moved.
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.                                         - Page 9 -
  534.  
  535.  
  536.  
  537.  
  538.  
  539.  
  540.                                                       MouseTrap Library, Rel 1.01
  541.                                                                 February 12, 1989
  542.  
  543.                                       Get_Mouse_Press
  544.                                      Get_Mouse_Release
  545.  
  546.                Syntax:
  547.                     mouse_t Get_Mouse_Press(mouse_t Button, mouse_t Status,      
  548.                                                    mouse_t *X,     mouse_t *Y);
  549.  
  550.                     mouse_t Get_Mouse_Release(mouse_t Button, mouse_t Status,    
  551.                                                    mouse_t *X,     mouse_t *Y);
  552.  
  553.  
  554.                Description:
  555.                     Get_Mouse_Press returns information about the last press of 
  556.                     one of the mouse buttons, given by the code "Button". The    
  557.                     coordinates of the location of the mouse cursor the last
  558.                     time that button was pressed are returned in X &  Y. The
  559.                     Function  itself returns the number of times that button was
  560.                     pressed since the last time  Get_Mouse_Press was called. The
  561.                     binary sum of the buttons currently pressed, as described in
  562.                     Get_Mouse_Position, is returned in Status.
  563.  
  564.                     Get_Mouse_Release works exactly the same way, with X and Y
  565.                     giving the location of the last position the button was
  566.                     released.
  567.  
  568.                Return Value:
  569.                     The number of time Button was pressed (released) since the   
  570.                     last call to Get_Mouse_Press (Get_Mouse_Release).
  571.  
  572.                See Also:
  573.                     Get_Mouse_Position 
  574.  
  575.                Example:
  576.                     #include <moustrap.h>
  577.                     #include <stdio.h>
  578.  
  579.                     main()
  580.                     {
  581.                          mouse_t s,x,y;
  582.                          if (Check_Mouse()) {
  583.                               getch();         /* pause of while */
  584.                               if (Get_Mouse_Press(M_Left,&s,&x,&y)) 
  585.                               printf("Left buttom was pressed at %d,%d\n", x,y);
  586.                               }
  587.                     }
  588.  
  589.  
  590.  
  591.  
  592.  
  593.                                         - Page 10 -
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.                                                       MouseTrap Library, Rel 1.01
  601.                                                                 February 12, 1989
  602.  
  603.                       Set_Mouse_Limit                         (v1.0)
  604.                       Set_Mouse_Limit_Horiz                   (v1.1)
  605.                       Set_Mouse_Limit_Vert                    (v1.1)
  606.                       Set_Mouse_Region                        (v1.1)
  607.  
  608.                Syntax:
  609.                     void    Set_Mouse_Limits(Direction, Min, Max);
  610.                     mouse_t Direction;       /* M_HORIZ -or- M_VERT */
  611.                     mouse_t Min;
  612.                     mouse_t Max;
  613.  
  614.                     void    Set_Mouse_Limits_Horiz(Left, Right);
  615.                     void    Set_Mouse_Limits_Vert(Top, Bottom);
  616.                     void    Set_Mouse_Region(Top, Left, Bottom, Right);          
  617.  
  618.                     mouse_t Top;
  619.                     mouse_t Left;
  620.                     mouse_t Bottom;
  621.                     mouse_t Right;
  622.  
  623.                Description:
  624.                     These functions give a variety of ways to forces the mouse   
  625.                     cursor's  movements to remain within specified limits. The
  626.                     various edges are given using graphic coordinates (0-629)
  627.                     (0-199).
  628.                     
  629.                          "That seems like a fairly simple concept", you should
  630.                     now be saying, "So, why does it take -FOUR- separate
  631.                     functions ?" Funny you should ask. In release 1.0, only
  632.                     Set_Mouse_Limit existed. It was functional, but inelegant, 
  633.                     since it required two calls to properly limit the cursor. It 
  634.                     was written that way mainly because the function it was
  635.                     adapted from was written that way. Realizing that this was a
  636.                     particularly poor reason to do something badly,
  637.                     Set_Mouse_Region was added.  It accomplishs the task with
  638.                     just one call, and  maintains  the  format of the other
  639.                     function  in the library.  However, it's not as flexible as 
  640.                     the original, so Set_Mouse_Limits_Horiz, and
  641.                     Set_Mouse_Limits_Vert were added. Set_Mouse_Limits hung
  642.                     around to maintain upward compatiblity with release 1.0      
  643.  
  644.                Return Value:
  645.                     None
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.                                         - Page 11 -
  657.  
  658.  
  659.  
  660.  
  661.  
  662.                                                       MouseTrap Library, Rel 1.01
  663.                                                                 February 12, 1989
  664.  
  665.  
  666.                Example:
  667.  
  668.                     #include <moustrap.h>
  669.                     #include <stdio.h>
  670.                     
  671.                     main()
  672.                     {
  673.                          Check_Mouse();
  674.  
  675.                          Set_Mouse_Region(50,160,150,480);
  676.                           /* Mouse is now limited to the center of the screen */ 
  677.  
  678.                          Read_Mouse();
  679.  
  680.                     }
  681.  
  682.  
  683.  
  684.  
  685.  
  686.  
  687.  
  688.  
  689.  
  690.  
  691.  
  692.  
  693.  
  694.  
  695.  
  696.  
  697.  
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.                                         - Page 12 -
  719.  
  720.  
  721.  
  722.  
  723.  
  724.                                                       MouseTrap Library, Rel 1.01
  725.                                                                 February 12, 1989
  726.  
  727.                                    Set_Mouse_Text_Cursor
  728.  
  729.                Syntax:
  730.                     void    Set_Mouse_Text_Cursor(Type, P1, P2);
  731.  
  732.                     mouse_t Type; /* 1 = Hardware Cursor | 0 = Software Cursor */
  733.                     mouse_t P1    /* Start scan line     |     Screen Mask     */
  734.                     mouse_t P2;   /* Stop  scan line     |     Cursor Mask     */
  735.  
  736.                Description:
  737.                          Set_Mouse_Text_Cursor describes how the mouse cursor
  738.                     will appear on the screen while in text modes.  This can be
  739.                     done in either of two way:  by using the Hardware cursor, or
  740.                     the Software cursor.  The Hardware cursor is the same one
  741.                     that the keyboard uses, that is, it looks just like the
  742.                     keyboard cursor, and can be moved  using the BIOS "move
  743.                     cursor"  functions.  If the hardware cursor is used,  P1  & 
  744.                     P2 give the scan lines for that cursor.  For normal screen
  745.                     uses that is 6 & 7.
  746.  
  747.                          The Software cursor is a little more complex.  There, P1
  748.                     is  the "Screen mask" and P2 is the "Cursor Mask", and they
  749.                     are given in the form of a color attribute and character. 
  750.                     When the software cursor is drawn on the screen,  the
  751.                     character and color attribute originally at that location is
  752.                     first ANDed with the screen mask, then the result of that is
  753.                     XORed with the cursor mask. If the screen mask is 0, the net
  754.                     effect is that the current value at that location is
  755.                     replaced by the cursor mask.  If the screen mask is      
  756.                     nonzero, the current value at the screen location WILL
  757.                     affect of character or color of the mouse cursor.
  758.  
  759.                          For example, if the screen mask was 0x0800, the color
  760.                     intensity bit (controlling brightness of the foreground)
  761.                     would be preserved.  Hence, the mouse cursor would become
  762.                     bright of it passed throught an area of bright text.  Or, if
  763.                     the screen mask was 0xF000, and the background color of the
  764.                     cursor mask was 0 (ie in the form  0x0---), the current
  765.                     background color will always be maintained underneath      
  766.                     the  mouse  cursor.  The effects become very strange if you
  767.                     use nonzero values in the character portion of the screen
  768.                     mask (the last two digits), which causes the screen character
  769.                     to affect the look of the mouse cursor.  This is best left to
  770.                     private experimentation.
  771.  
  772.                Return Value:
  773.                     None.
  774.  
  775.                See Also:
  776.                     TC() macro Set_Mouse_Graphic_Cursor
  777.  
  778.  
  779.  
  780.                                         - Page 13 -
  781.  
  782.  
  783.  
  784.  
  785.  
  786.                                                       MouseTrap Library, Rel 1.01
  787.                                                                 February 12, 1989
  788.  
  789.                                  Set_Mouse_Graphic_Cursor
  790.  
  791.                Syntax:
  792.                     void Set_Mouse_Graphic_Cursor(mouse_t Hot_X, mouse_t Hot_Y,  
  793.                                                   mouse_t Cursor[2][16]);
  794.  
  795.                Description:
  796.                          Set_Mouse_Graphic_Cursor changes how the mouse cursor
  797.                     will appear on the screen,  while in graphic modes.  The
  798.                     graphic cursor can  be  used in any of the graphic modes.  
  799.                     The graphic cursor is defined  by two 16 bit by 16 bit
  800.                     arrays, the screen mask, and  the cursor mask.  This defines 
  801.                     a 16 by 16 pixel square in high-resolution or EGA mode, an 8
  802.                     by 16 pixel block in medium resolution 4-color mode, and a 4
  803.                     by 16 pixel block in low resolution 16 color mode.
  804.  
  805.                          When a graphic cursor is displayed on  the  screen,
  806.                     three operations take place.  First, the screen image "under"
  807.                     the cursor is saved, Then, the screen mask is logically ANDed
  808.                     with the  screen image.  Finally, the cursor mask is logic-
  809.                     ally XORed with the result of the first operation.
  810.  
  811.                     The logically result of these operations is:
  812.                        Screen mask     Cursor Mask      Result
  813.                              0              0             0
  814.                              0              1             1
  815.                              1              0           Same as original bit     
  816.                              1              1           Inverse of original bit. 
  817.  
  818.                          Remember, in CGA color modes,  more than one bit is
  819.                     required  for each pixel.
  820.  
  821.                Return Value:
  822.                     None
  823.  
  824.                See Also:
  825.                     Set_Mouse_Text_Cursor  Peace[][]  CrossHair[][]  Lightening[][]
  826.  
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839.  
  840.  
  841.  
  842.                                         - Page 14 -
  843.  
  844.  
  845.  
  846.  
  847.  
  848.                                                       MouseTrap Library, Rel 1.01
  849.                                                                 February 12, 1989
  850.  
  851.                Example:
  852.                     #include <moustrap.h>
  853.                     #include <stdio.h>
  854.  
  855.                     mouse_t Lightening[2][16] = {
  856.                          {
  857.                          0xFFF7,         /* 11111111 11110111b    */
  858.                          0xFFCF,         /* 11111111 11001111b    */
  859.                          0xFF9F,         /* 11111111 10011111b    */
  860.                          0xFF3F,         /* 11111111 00111111b    */
  861.                          0xFE7F,         /* 11111110 01111111b    */
  862.                          0xFCFF,         /* 11111100 11111111b    */
  863.                          0xF9FF,         /* 11111001 11111111b    */
  864.                          0xF803,         /* 11111000 00000111b    */
  865.                          0xFFE3,         /* 11111111 11100111b    */
  866.                          0xFFCF,         /* 11111111 11001111b    */
  867.                          0xFF9F,         /* 11111111 10011111b    */
  868.                          0xFF3F,         /* 11111111 00111111b    */
  869.                          0xFE7F,         /* 11111110 01111111b    */
  870.                          0xFCFF,         /* 11111100 11111111b    */
  871.                          0xF9FF,         /* 11111001 11111111b    */
  872.                          0xF7FF},        /* 11110111 11111111b    */
  873.  
  874.                          {0x0008,         /* 00000000 00001000b    */
  875.                           0x0030,         /* 00000000 00110000b    */
  876.                           0x0060,         /* 00000000 01100000b    */
  877.                           0x00C0,         /* 00000000 11000000b    */
  878.                           0x0180,         /* 00000001 10000000b    */
  879.                           0x0300,         /* 00000011 00000000b    */
  880.                           0x0600,         /* 00000110 00000000b    */
  881.                           0x03F8,         /* 00000111 11111000b    */
  882.                           0x0018,         /* 00000000 00011000b    */
  883.                           0x0030,         /* 00000000 00110000b    */
  884.                           0x0060,         /* 00000000 01100000b    */
  885.                           0x00C0,         /* 00000000 11000000b    */
  886.                           0x0180,         /* 00000001 10000000b    */
  887.                           0x0300,         /* 00000011 00000000b    */
  888.                           0x0600,         /* 00000110 00000000b    */
  889.                           0x0800}         /* 00001000 00000000b    */
  890.                           };  
  891.  
  892.                     main()
  893.                     {
  894.                          mouse_t s,x,y;
  895.                          
  896.                          if (Check_Mouse()) {
  897.                               Set_Mouse_Graphic_Cursor(4,15,Lightening);
  898.                               Show_Mouse();
  899.                               }
  900.                     }
  901.  
  902.  
  903.  
  904.                                         - Page 15 -
  905.  
  906.  
  907.  
  908.  
  909.  
  910.                                                       MouseTrap Library, Rel 1.01
  911.                                                                 February 12, 1989
  912.  
  913.                                Chapter 3
  914.                                        Advanced Mouse Control Functions
  915.  
  916.  
  917.                     These thirteen functions simplify the process of interpreting
  918.                     the users input using a mouse.  They work on the assumption
  919.                     that most of the time a mouse is used by "clicking" a
  920.                     specific button at a specific place on the screen. They were
  921.                     written using Microsoft's C v5.1.  
  922.  
  923.  
  924.                        Activate_Mouse_Page()
  925.                        Add_Mouse_Button()
  926.                        Add_Mouse_Hot_Spot()
  927.                        Add_Mouse_Page()
  928.                        Clear_All_Mouse_Definition()
  929.                        Clear_Mouse_Pages()
  930.                        DeActivate_Mouse_Page()
  931.                        Define_Mouse_System()
  932.                        Delete_Mouse_Button()
  933.                        Delete_Mouse_Hot_Spot()
  934.                        Delete_Mouse_Page()
  935.                        Get_Char_Mouse_Kbd()
  936.                        Read_Mouse() 
  937.                        Read_Mouse_Kbd()
  938.  
  939.  
  940.  
  941.  
  942.  
  943.  
  944.  
  945.  
  946.  
  947.  
  948.  
  949.  
  950.  
  951.  
  952.  
  953.  
  954.  
  955.  
  956.  
  957.  
  958.  
  959.  
  960.  
  961.  
  962.  
  963.  
  964.  
  965.  
  966.                                         - Page 16 -
  967.  
  968.  
  969.  
  970.  
  971.  
  972.                                                       MouseTrap Library, Rel 1.01
  973.                                                                 February 12, 1989
  974.  
  975.                                     Activate_Mouse_Page
  976.                   
  977.                Syntax:
  978.                     #include <moustrap.h>
  979.                     mouse_t Activate_Mouse_Page(mouse_t Page_ID)
  980.  
  981.                Description:
  982.                          The Activate_Mouse_Page function sets active one of the 
  983.                     previously defined mouse pages.  In Single Page mode, the
  984.                     currently active page is cleared, and the mouse cursor is
  985.                     limited to the area of that page. In Overlaid mode, the current
  986.                     pages remain active, and the mouse cursor area is widened, if
  987.                     necessary, to accommodate the new page.
  988.  
  989.                Return Value:
  990.                     MNOERROR if there was no problem, otherwise
  991.                     MERROR with M_Error set to the specific error.
  992.  
  993.                See Also:
  994.                     M_Error, DeActivate_Mouse_Page, Add_Mouse_Page
  995.  
  996.                Example:
  997.  
  998.                        See Chapter 4.
  999.  
  1000.  
  1001.  
  1002.  
  1003.  
  1004.  
  1005.  
  1006.  
  1007.  
  1008.  
  1009.  
  1010.  
  1011.  
  1012.  
  1013.  
  1014.  
  1015.  
  1016.  
  1017.  
  1018.  
  1019.  
  1020.  
  1021.  
  1022.  
  1023.  
  1024.  
  1025.  
  1026.  
  1027.  
  1028.                                         - Page 17 -
  1029.  
  1030.  
  1031.  
  1032.  
  1033.  
  1034.                                                       MouseTrap Library, Rel 1.01
  1035.                                                                 February 12, 1989
  1036.  
  1037.                                       Add_Mouse_Page
  1038.                Syntax:
  1039.                     #include <moustrap.h>
  1040.  
  1041.                     mouse_t Add_Mouse_Page(Page_Type, Top, Left, Bottom, Right);
  1042.  
  1043.                     mouse_t         Page_Type;      /* M_Text_Coord    or  */    
  1044.                                                     /* M_Graphic_Coord     */    
  1045.                     mouse_t         Top;
  1046.                     mouse_t         Left;           /* Coordinates of corners */ 
  1047.                     mouse_t         Bottom;         /* of the page.           */ 
  1048.                     mouse_t         Right; 
  1049.  
  1050.                Description:
  1051.                          Defines a new mouse page which is added  to  the 
  1052.                     system.  Page_Type tells if the corner points are given using
  1053.                     text coordinates (80x25) or Graphic coordinates (640x200).
  1054.                     Coordinates of Hot Spots for this page are also assumed to
  1055.                     be given using that system.
  1056.  
  1057.                Return Value:
  1058.                          Returns a Page ID number, which is to be used to
  1059.                     reference  this page in the future, or, MERROR if there was a
  1060.                     problem,  with it's cause given in M_Error. 
  1061.  
  1062.                See Also:
  1063.                     Delete_Mouse_Page, Add_Mouse_Button, Add_Mouse_Hot_Spot      
  1064.                     M_Error, Activate_Mouse_Page, DeActivate_Mouse_Page     
  1065.  
  1066.                Example:
  1067.  
  1068.                     See Chapter 4.
  1069.  
  1070.  
  1071.  
  1072.  
  1073.  
  1074.  
  1075.  
  1076.  
  1077.  
  1078.  
  1079.  
  1080.  
  1081.  
  1082.  
  1083.  
  1084.  
  1085.  
  1086.  
  1087.  
  1088.  
  1089.  
  1090.                                         - Page 18 -
  1091.  
  1092.  
  1093.  
  1094.  
  1095.  
  1096.                                                       MouseTrap Library, Rel 1.01
  1097.                                                                 February 12, 1989
  1098.  
  1099.                                      Add_Mouse_Button
  1100.                Syntax:
  1101.                     #include <moustrap.h>
  1102.  
  1103.                     mouse_t Add_Mouse_Button(Page_ID, Button, Return_Value);
  1104.                     mouse_t Page_ID;
  1105.                     mouse_t Button;
  1106.                     mouse_t Return_Value;
  1107.                        
  1108.                Description:
  1109.                          Add_Mouse_Button  lets you tell the system how to react
  1110.                     to a certain button being pressed.  Page_ID is the page
  1111.                     which this definition refers to, or if 0, the definition is
  1112.                     valid in all pages.  Button is either M_Left, M_Right, or
  1113.                     M_Center.  If the Return_Value is 0, it's assumed the Hot
  1114.                     Spots are associated with this button in this page. Otherwise,
  1115.                     the Return_Value is any value the user wished to assign. 
  1116.                     It's return by Read_Mouse and Get_Char_Mouse_Kbd if that
  1117.                     button is pressed while that page is active.  In Overlaid
  1118.                     mode, if more than one page, with conflicting definitions,
  1119.                     are active the most recent Add_Mouse_Button has precedence. 
  1120.                     Any definition of a particular Page/Button combination
  1121.                     replaces any previous definition of that combination.
  1122.                 
  1123.                Return Value:
  1124.                     MNOERROR if there was no problem; otherwise
  1125.                     MERROR with the specific error given in M_Error
  1126.  
  1127.                See Also
  1128.                     M_Error, Add_Mouse_Page, Add_Mouse_Hot_Spot
  1129.  
  1130.                Example:
  1131.                     See Chapter 4.
  1132.  
  1133.  
  1134.  
  1135.  
  1136.  
  1137.  
  1138.  
  1139.  
  1140.  
  1141.  
  1142.  
  1143.  
  1144.  
  1145.  
  1146.  
  1147.  
  1148.  
  1149.  
  1150.  
  1151.  
  1152.                                         - Page 19 -
  1153.  
  1154.  
  1155.  
  1156.  
  1157.  
  1158.                                                       MouseTrap Library, Rel 1.01
  1159.                                                                 February 12, 1989
  1160.  
  1161.                                     Add_Mouse_Hot_Spot
  1162.                Syntax:
  1163.                     #include <moustrap.h>
  1164.                        
  1165.                     mouse_t Add_Mouse_Hot_Spot(Page_ID, Button, Top, Left,       
  1166.                                            Bottom, Right, Return_Value);         
  1167.                     mouse_t Page_ID;
  1168.                     mouse_t Button;
  1169.                     mouse_t Top;            /* corner of the area */
  1170.                     mouse_t Left;
  1171.                     mouse_t Bottom;
  1172.                     mouse_t Right;
  1173.                     mouse_t Return_Value;
  1174.  
  1175.                Description:
  1176.                          Add_Mouse_Hot_Spot defines an area such that if the     
  1177.                     appropriate Button is pressed while the mouse cursor is
  1178.                     within the area given while the page given by Page_ID is 
  1179.                     active, Read_Mouse will return Return_Value. A  maximum of
  1180.                     65535 hot spots can be defined.
  1181.  
  1182.                Return Value:
  1183.                          An  ID  number for this hot spot,  if there was no
  1184.                     problem; otherwise MERROR with the specific error given in M_Error.
  1185.                        
  1186.                See Also:
  1187.                     M_Error, Delete_Mouse_Hot_Spot
  1188.  
  1189.                Example:
  1190.                     See Chapter 4.
  1191.                     
  1192.  
  1193.  
  1194.  
  1195.  
  1196.  
  1197.  
  1198.  
  1199.  
  1200.  
  1201.  
  1202.  
  1203.  
  1204.  
  1205.  
  1206.  
  1207.  
  1208.  
  1209.  
  1210.  
  1211.  
  1212.  
  1213.  
  1214.                                         - Page 20 -
  1215.  
  1216.  
  1217.  
  1218.  
  1219.  
  1220.                                                       MouseTrap Library, Rel 1.01
  1221.                                                                 February 12, 1989
  1222.  
  1223.                                 Clear_All_Mouse_Definitions
  1224.                Syntax:
  1225.                     #include <moustrap.h>
  1226.                        
  1227.                     mouse_t Clear_All_Mouse_Definitions(void);
  1228.  
  1229.                Description:
  1230.                          Erases everything.  Removes all Page,  Button,  and Hot
  1231.                     Spot definitions. Reset various internal variables.  Must be
  1232.                     done before switching between Single Page & Overlaid modes.
  1233.  
  1234.                Return Value:
  1235.                     MNOERROR if there was no problem; otherwise
  1236.                     MERROR with the specific error given in M_Error
  1237.                      
  1238.                See Also:
  1239.                     M_Error, Define_Mouse_System
  1240.  
  1241.                Example:
  1242.                     See Chapter 4.
  1243.                     
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260.  
  1261.  
  1262.  
  1263.  
  1264.  
  1265.  
  1266.  
  1267.  
  1268.  
  1269.  
  1270.  
  1271.  
  1272.  
  1273.  
  1274.  
  1275.  
  1276.                                         - Page 21 -
  1277.  
  1278.  
  1279.  
  1280.  
  1281.  
  1282.                                                       MouseTrap Library, Rel 1.01
  1283.                                                                 February 12, 1989
  1284.  
  1285.                                      Clear_Mouse_Pages
  1286.                Syntax:
  1287.                     #include <moustrap.h>
  1288.  
  1289.                     mouse_t Clear_Mouse_Pages(void);
  1290.                        
  1291.                Description:
  1292.                          Deactivates  all mouse pages.  Hides cursors.  Resets
  1293.                     cursor limits.
  1294.  
  1295.                Return Value:
  1296.                     MNOERROR if there was no problem; otherwise
  1297.                     MERROR with the specific error given in M_Error
  1298.                        
  1299.                See Also:
  1300.                     M_Error, DeActivate_Mouse_Page, Activate_Mouse_Cursor
  1301.  
  1302.                Example:
  1303.                     See Chapter 4.
  1304.  
  1305.  
  1306.  
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  
  1325.  
  1326.  
  1327.  
  1328.  
  1329.  
  1330.  
  1331.  
  1332.  
  1333.  
  1334.  
  1335.  
  1336.  
  1337.  
  1338.                                         - Page 22 -
  1339.  
  1340.  
  1341.  
  1342.  
  1343.  
  1344.                                                       MouseTrap Library, Rel 1.01
  1345.                                                                 February 12, 1989
  1346.  
  1347.                                    DeActivate_Mouse_Page
  1348.                Syntax:
  1349.                     #include <moustrap.h>
  1350.  
  1351.                     mouse_t DeActivate_Mouse_Page(Page_ID);
  1352.                     mouse_t Page_ID;
  1353.                        
  1354.                Description:
  1355.                     Deactivates the referenced mouse page.  Button and Hot Spot 
  1356.                     definitions linked to that page will no longer function until 
  1357.                     restarted with Activate_Mouse_Page.  On Single page mode, 
  1358.                     this is done automatically when another page is activated.
  1359.  
  1360.                Return Value:
  1361.                     MNOERROR if there was no problem; otherwise
  1362.                     MERROR with the specific error given in M_Error
  1363.                     
  1364.                See Also:
  1365.                     M_Error  Activate_Mouse_Page, Clear_Mouse_Pages
  1366.  
  1367.                Example:
  1368.                     See Chapter 4.
  1369.                     
  1370.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.  
  1394.  
  1395.  
  1396.  
  1397.  
  1398.  
  1399.  
  1400.                                         - Page 23 -
  1401.  
  1402.  
  1403.  
  1404.  
  1405.  
  1406.                                                       MouseTrap Library, Rel 1.01
  1407.                                                                 February 12, 1989
  1408.  
  1409.                                     Define_Mouse_System
  1410.                Syntax:
  1411.                     #include <moustrap.h>
  1412.                        
  1413.                     mouse_t Define_Mouse_System(Page_Type);
  1414.                     mouse_t Page_type;
  1415.                                
  1416.                Description:
  1417.                     Define_Mouse_System declares how mouse pages are to be used 
  1418.                     through the program.  Page_Type must be either M_Overlaid_Pages
  1419.                     or M_Single_Pages.  Automatically initializes mouse by
  1420.                     executing Check_Mouse.  Can only be done once in a program
  1421.                     unless reset with Clear_All_Mouse_Definitions.
  1422.  
  1423.                Return Value:
  1424.                     MNOERROR if there was no problem; otherwise
  1425.                     MERROR with the specific error given in M_Error
  1426.                        
  1427.                See Also:
  1428.                     M_Error, Clear_All_Mouse_Definitions, Check_Mouse
  1429.  
  1430.                Example:
  1431.                     See Chapter 4.
  1432.  
  1433.  
  1434.  
  1435.  
  1436.  
  1437.  
  1438.  
  1439.  
  1440.  
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.  
  1457.  
  1458.  
  1459.  
  1460.  
  1461.  
  1462.                                         - Page 24 -
  1463.  
  1464.  
  1465.  
  1466.  
  1467.  
  1468.                                                       MouseTrap Library, Rel 1.01
  1469.                                                                 February 12, 1989
  1470.  
  1471.                                     Delete_Mouse_Button
  1472.                                    Delete_Mouse_Hot_Spot
  1473.                                      Delete_Mouse_Page
  1474.                Syntax:
  1475.                     #include <moustrap.h>
  1476.  
  1477.                     mouse_t Delete_Mouse_Button(mouse_t Page_ID, mouse_t Button); 
  1478.                     mouse_t Delete_Mouse_Hot_Spot(mouse_t HS_ID);
  1479.                     mouse_t Delete_Mouse_Page(mouse_t Page_ID);
  1480.  
  1481.                Description:
  1482.                     Removes the indicated item from the system.
  1483.  
  1484.                Return Value:
  1485.                     MNOERROR if there was no problem; otherwise
  1486.                     MERROR with the specific error given in M_Error
  1487.                        
  1488.                See Also:
  1489.                     M_Error
  1490.  
  1491.                Example:
  1492.                     See Chapter 4.
  1493.  
  1494.  
  1495.  
  1496.  
  1497.  
  1498.  
  1499.  
  1500.  
  1501.  
  1502.  
  1503.  
  1504.  
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514.  
  1515.  
  1516.  
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522.  
  1523.  
  1524.                                         - Page 25 -
  1525.  
  1526.  
  1527.  
  1528.  
  1529.  
  1530.                                                       MouseTrap Library, Rel 1.01
  1531.                                                                 February 12, 1989
  1532.  
  1533.                                     Get_Char_Mouse_Kbd
  1534.                Syntax:
  1535.                     #include <moustrap.h>
  1536.  
  1537.                     mouse_t Get_Char_Mouse_Kbd(void);
  1538.                        
  1539.                Description
  1540.                     Get_Char_Mouse_Kbd acts much like the standard library      
  1541.                     function GETCH, but will accept input from either the
  1542.                     keyboard or the mouse.  Will return only when some input is
  1543.                     received from the keyboard or mouse. 
  1544.  
  1545.                Return Value:
  1546.                     The value inputted if there was no problem; otherwise        
  1547.                     MERROR with the specific error given in M_Error
  1548.  
  1549.                See Also:
  1550.                     M_Error, Read_Mouse
  1551.  
  1552.                Example:
  1553.                     See Chapter 4.
  1554.  
  1555.  
  1556.  
  1557.  
  1558.  
  1559.  
  1560.  
  1561.  
  1562.  
  1563.  
  1564.  
  1565.  
  1566.  
  1567.  
  1568.  
  1569.  
  1570.  
  1571.  
  1572.  
  1573.  
  1574.  
  1575.  
  1576.  
  1577.  
  1578.  
  1579.  
  1580.  
  1581.  
  1582.  
  1583.  
  1584.  
  1585.  
  1586.                                         - Page 26 -
  1587.  
  1588.  
  1589.  
  1590.  
  1591.  
  1592.                                                       MouseTrap Library, Rel 1.01
  1593.                                                                 February 12, 1989
  1594.  
  1595.                                         Read_Mouse
  1596.                Syntax:
  1597.                     #include <moustrap.h>
  1598.                        
  1599.                     mouse_t Read_Mouse(void)
  1600.  
  1601.                Description:
  1602.                     Checks mouse for input.
  1603.  
  1604.                Return Value:
  1605.                     The  Return_value assigned to a Button or Hot Spot,  if that 
  1606.                     item was "clicked" on, or
  1607.                     MERROR if an error occured, or
  1608.                     0 if no button was pressed.
  1609.  
  1610.                See Also:
  1611.                     M_Error, Get_Char_Mouse_Kbd
  1612.  
  1613.                Example:
  1614.                     See Chapter 4.
  1615.  
  1616.                NOTE:
  1617.                     Remember, a non-zero return value does not necessarily mean 
  1618.                     a button was pressed;  it could also indicate an error 
  1619.                     condition. (MNOINIT or MNOACTIVE). 
  1620.  
  1621.  
  1622.  
  1623.  
  1624.  
  1625.  
  1626.  
  1627.  
  1628.  
  1629.  
  1630.  
  1631.  
  1632.  
  1633.  
  1634.  
  1635.  
  1636.  
  1637.  
  1638.  
  1639.  
  1640.  
  1641.  
  1642.  
  1643.  
  1644.  
  1645.  
  1646.  
  1647.  
  1648.                                         - Page 27 -
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654.                                                       MouseTrap Library, Rel 1.01
  1655.                                                                 February 12, 1989
  1656.  
  1657.                                       Read_Mouse_Kbd
  1658.                Syntax:
  1659.                     #include <moustrap.h>
  1660.                        
  1661.                     mouse_t Read_Mouse_Kbd(void)
  1662.  
  1663.                Description:
  1664.                     Something between Read_Mouse and Get_Mouse_Kbd_Char.         
  1665.                     Checks mouse and the keyboard for input.
  1666.  
  1667.                Return Value:
  1668.                     The  Return_value assigned to a Button or Hot Spot,  if that 
  1669.                     item was "clicked" on, or
  1670.                     a key pressed on the keyboard.
  1671.                     MERROR if an error occured, or
  1672.                     0 if no button or key was pressed.
  1673.  
  1674.                See Also:
  1675.                     M_Error, Get_Char_Mouse_Kbd
  1676.  
  1677.                Example:
  1678.                     See Chapter 4.
  1679.  
  1680.                NOTE:
  1681.                     Remember,  a non-zero return value does not necessarily mean 
  1682.                     a button was pressed;  it could also indicate an error 
  1683.                     condition. (MNOINIT or MNOACTIVE). 
  1684.  
  1685.  
  1686.  
  1687.  
  1688.  
  1689.  
  1690.  
  1691.  
  1692.  
  1693.  
  1694.  
  1695.  
  1696.  
  1697.  
  1698.  
  1699.  
  1700.  
  1701.  
  1702.  
  1703.  
  1704.  
  1705.  
  1706.  
  1707.  
  1708.  
  1709.  
  1710.                                         - Page 28 -
  1711.  
  1712.  
  1713.  
  1714.  
  1715.  
  1716.                                                       MouseTrap Library, Rel 1.01
  1717.                                                                 February 12, 1989
  1718.  
  1719.                        Chapter 4
  1720.  
  1721.                                        Using the MouseTrap Library
  1722.  
  1723.                The  basic concept of the MouseTrap is the "Mouse Page".  A      
  1724.           Mouse Page is one set of button and "Hot spot" definitions.  Any      
  1725.           character can be assigned to a button or hot spot.  Pages can  be     
  1726.           used in either of two ways:  You can have up ot 65,000 single pages,  
  1727.           which can only be used one at a time, or up to 16 page "overlaid"   
  1728.           pages, any combination of which can be active at once.  You choose
  1729.           this by using the Define_Mouse_System function, with either      
  1730.           M_Single_Pages or M_Overlaid_Pages.  
  1731.  
  1732.                The next step is to define a page, by using the Add_Mouse_Page 
  1733.           function, passing to it the "type" of page it is, either M_Graphic_Coord
  1734.           or M_Text_Coord; and the 4 corner points for that page using the
  1735.           appropriate set of coordinates (either 80x25 or 640x200).  Using "0" 
  1736.           for each corner will have it using the entire screen.  Add_Mouse_Page
  1737.           will return an ID number for the page, which you will be using in all future
  1738.           references to this page.
  1739.  
  1740.                Next, you must define the buttons you will be using.  This is done
  1741.           with Add_Mouse_Button.  You tell it which for which page and button
  1742.           this definition is to apply, and the value to return if that button was
  1743.           clicked while that page was active.  If you use "0" for the  Page ID, 
  1744.           this definition will apply to all pages.  If you use "0" for the
  1745.           return value,  you can have that button return different values for
  1746.           being clicked at different "hot spots" within the page.
  1747.  
  1748.                If you are using hot spots in a page, you must next call Add_Mouse-
  1749.           _Hot_Spot,  passing to it the page ID and button code,  the corner
  1750.           points, and the return value for the spot.
  1751.  
  1752.                Now, we get to the fun part.  Choose a page using the  Activate-
  1753.           _Mouse_Page  function.  Using  overlaid page,  you can  have several  
  1754.           pages active at once; remove them with the DeActivate_Mouse_Page or
  1755.           Clear_Mouse_Pages function.  In single page mode, activating a new page
  1756.           automatically deactivates the last one. 
  1757.  
  1758.                Finally,  simply call Read_Mouse().  It will return either the 
  1759.           value for the button or Hot spot clicked or 0 if no button  was
  1760.           clicked.   Or simpler still,  use Get_Char_Mouse_Kbd(),  which waits
  1761.           until some input is entered by either keyboard or mouse.
  1762.  
  1763.  
  1764.  
  1765.  
  1766.  
  1767.  
  1768.  
  1769.  
  1770.  
  1771.  
  1772.                                         - Page 29 -
  1773.  
  1774.  
  1775.  
  1776.  
  1777.  
  1778.                                                       MouseTrap Library, Rel 1.01
  1779.                                                                 February 12, 1989
  1780.  
  1781.                To further exemplify the process let's examine the  sample
  1782.           program MICETEST.C:
  1783.  
  1784.                #include <stdio.h>
  1785.                #include "moustrap.h"
  1786.  
  1787.                #include <graph.h>
  1788.  
  1789.                main ()
  1790.                {
  1791.                        mouse_t y,z,c;
  1792.                     
  1793.                The data type "mouse_t" is defined in MOUSTRAP.H.  All variables 
  1794.           used with the MouseTrap library should be define as this type. 
  1795.  
  1796.                The first group of lines setup the screen so it's easier to
  1797.           understand what's happening with the mouse.  But by themselves they  
  1798.           do nothing of interest to this discussion.  Ignore them and skip down a
  1799.           bit.
  1800.                    
  1801.                        Define_Mouse_System(M_Single_Pages);
  1802.  
  1803.                For the first step, we going to be using single pages;  only one
  1804.           of the pages we're about the define can be active at only given time.
  1805.  
  1806.                        y=Add_Mouse_Page(M_Text_Coord,15,20,24,40); 
  1807.  
  1808.                        z=Add_Mouse_Page(M_Text_Coord,5,10,15,20);  
  1809.  
  1810.                Next, we define two mouse pages, Y &  Z.  Y is limited to the 
  1811.           rectangle from row 15, column 20 to row 24, column 40. Similarly, Z   
  1812.           is the area from (5,10) to (15,20). 
  1813.  
  1814.                        Set_Mouse_Text_Cursor(0,0,TC(' ',4,4));
  1815.  
  1816.                Now, we describe how the mouse cursor will look.   We start with 
  1817.           something simple.  We'll use a software cursor, with no screen mask.   
  1818.           We use  the macro TC(),  defined in MOUSTRAP.H,  to build a  cursor    
  1819.             which  is  just a space,  with a red foreground (color 4)  on a  red 
  1820.                background.
  1821.  
  1822.                        Add_Mouse_Button(0,M_Middle,'2');
  1823.  
  1824.                For  our first button definition,  we'll say that anytime the
  1825.           Middle       button  is pressed,  Read_Mouse will return an ASCII
  1826.           character  '2',       regardless  of  what page is active (provided at
  1827.           least one  page  IS       active).
  1828.  
  1829.                        Add_Mouse_Button(z,M_Left,'1');
  1830.  
  1831.                Next  we'll  have  pressing  the Left button  return  an  ASCII 
  1832.           '1'       whenever page Z is active.
  1833.  
  1834.                                         - Page 30 -
  1835.  
  1836.  
  1837.  
  1838.  
  1839.  
  1840.                                                       MouseTrap Library, Rel 1.01
  1841.                                                                 February 12, 1989
  1842.  
  1843.  
  1844.                        Add_Mouse_Button(z,M_Right,0);
  1845.                        Add_Mouse_Hot_Spot(z,M_Right,7,13,13,18,'C');
  1846.  
  1847.                Now, we add our first Hot Spot.  Here,  we must first declare 
  1848.           the Right button in Page Z, then we declare the area in the rectangle 
  1849.           (7,13) - (13,18) as a hot spot returning the character 'C' when that   
  1850.           button is pressed while page Z is active.  Since no other hot spot is
  1851.           defined, clicking the right button outside that area will return 0,
  1852.           just as if no click had occurred.
  1853.  
  1854.                        Add_Mouse_Button(y,M_Left,0);
  1855.  
  1856.                        Add_Mouse_Hot_Spot(y,M_Left,15,20,24,30,'L');
  1857.                        Add_Mouse_Hot_Spot(y,M_Left,15,30,24,40,'R');
  1858.  
  1859.                Continuing in a similar vein, we define two hot spots in page Y. 
  1860.           When the Left button is pressed, if the cursor is in the left side
  1861.           we'll get the character 'L', while the right side return the character
  1862.           'R'.
  1863.                         
  1864.                do {
  1865.                        
  1866.                        Activate_Mouse_Page(z);
  1867.                        
  1868.                As we enter the loop, we activate page Z.  The mouse cursor is   
  1869.           "turned on" with it's movement limited to the edges of the page.  
  1870.                        c=Get_Char_Mouse_Kbd();
  1871.                        printf("Page Z: Character \"%c\"",c);
  1872.  
  1873.                We stop, and get a character from either the keyboard (which is
  1874.           not much fun), or via the mouse; and print it.
  1875.  
  1876.                        Activate_Mouse_Page(y);
  1877.                        c=Get_Char_Mouse_Kbd();
  1878.                        printf("Page Y: Character \"%c\"",c);
  1879.  
  1880.                Now, we activate page Y (which automatically deactivates page 
  1881.           Z).  The mouse cursor moves into the new area, and it's motion is
  1882.           limited  to that range.  We get another character and print it.
  1883.                       
  1884.                        } while (c!='Q');
  1885.  
  1886.                        Clear_All_Mouse_Definitions();
  1887.  
  1888.                        Define_Mouse_System(M_Overlaid_Pages);
  1889.  
  1890.                Now, we want to start over, so we clear all the old definitions, 
  1891.           and restart, but this time using overlaid pages.
  1892.  
  1893.                        y=Add_Mouse_Page(M_Text_Coord,15,20,24,40); 
  1894.                        z=Add_Mouse_Page(M_Text_Coord,5,10,15,20); 
  1895.  
  1896.                                         - Page 31 -
  1897.  
  1898.  
  1899.  
  1900.  
  1901.  
  1902.                                                       MouseTrap Library, Rel 1.01
  1903.                                                                 February 12, 1989
  1904.  
  1905.                        Add_Mouse_Button(0,M_Middle,'2');
  1906.                        Add_Mouse_Button(z,M_Left,'1');
  1907.                        Add_Mouse_Button(z,M_Right,0);
  1908.                        Add_Mouse_Hot_Spot(z,M_Right,7,13,13,18,'C');
  1909.                        Add_Mouse_Button(y,M_Left,0);
  1910.                        Add_Mouse_Hot_Spot(y,M_Left,15,20,24,30,'L');
  1911.                        Add_Mouse_Hot_Spot(y,M_Left,15,30,24,40,'R');
  1912.  
  1913.                        Set_Mouse_Text_Cursor(0,0,TC('+',4,2));
  1914.  
  1915.                We'll redefine all of our pages, buttons, and hot spots, exactly
  1916.           as we did the first time.  We'll also change the mouse  cursor, this   
  1917.           time to something a bit more exciting than before, a red plus sign   
  1918.           on a green background (color 2).
  1919.  
  1920.                do {
  1921.                        Activate_Mouse_Page(z);
  1922.                        c=Get_Char_Mouse_Kbd();
  1923.                        printf("Page Z: Character \"%c\"",c);
  1924.  
  1925.                Again, we activate page Z, and get a character from it.  This
  1926.           works exactly as it did in  the first loop using single page mode.
  1927.  
  1928.                        DeActivate_Mouse_Page(z);  
  1929.                        Activate_Mouse_Page(y);
  1930.                        c=Get_Char_Mouse_Kbd();
  1931.                        printf("Page Y: Character \"%c\"",c);
  1932.  
  1933.                And again, we activate page Y, and get a character from it.  The 
  1934.           only difference is that we had to first deactivate page Z.
  1935.  
  1936.                        Activate_Mouse_Page(z);
  1937.                        c=Get_Char_Mouse_Kbd();
  1938.                        printf("Page Y & Z: Character \"%c\"",c);
  1939.                        
  1940.                Now we get flashy.  Without deactivate page Y, we'll reactivate
  1941.           page Z.  You will notice that the mouse can now move within a much
  1942.           larger area, specifically the rectangle which circumscribes both of 
  1943.           the smaller rectangle.  Notice that if you click the left button in
  1944.           the area that is not within the boundaries of either page,  "1" will
  1945.           be return.  This  is because the button definition says to return  "1" 
  1946.           whenever page Z is active,  regardless of where the cursor is,  even   
  1947.           if  it is outside the stated area of Page Z.  However, notice that   
  1948.           the Hot Spots of the left button in page Y, take precedence over this. 
  1949.           This  is  because the BUTTON definition on page Y was give after the
  1950.           button definition off page Z, and therefore overrules it.
  1951.  
  1952.                        DeActivate_Mouse_Page(y);  
  1953.  
  1954.                Now, we deactivate page Y, leaving only page Z.  Notice that the 
  1955.           mouse's movements are once again restricted to the area of page Z.   
  1956.           (See..I told you that I would fix this problem with release 1.01)
  1957.  
  1958.                                         - Page 32 -
  1959.  
  1960.  
  1961.  
  1962.  
  1963.  
  1964.                                                       MouseTrap Library, Rel 1.01
  1965.                                                                 February 12, 1989
  1966.  
  1967.  
  1968.                        }
  1969.                }
  1970.  
  1971.  
  1972.  
  1973.  
  1974.  
  1975.  
  1976.  
  1977.  
  1978.  
  1979.  
  1980.  
  1981.  
  1982.  
  1983.  
  1984.  
  1985.  
  1986.  
  1987.  
  1988.  
  1989.  
  1990.  
  1991.  
  1992.  
  1993.  
  1994.  
  1995.  
  1996.  
  1997.  
  1998.  
  1999.  
  2000.  
  2001.  
  2002.  
  2003.  
  2004.  
  2005.  
  2006.  
  2007.  
  2008.  
  2009.  
  2010.  
  2011.  
  2012.  
  2013.  
  2014.  
  2015.  
  2016.  
  2017.  
  2018.  
  2019.  
  2020.                                         - Page 33 -
  2021.  
  2022.  
  2023.  
  2024.  
  2025.  
  2026.                                                       MouseTrap Library, Rel 1.01
  2027.                                                                 February 12, 1989
  2028.  
  2029.                You should also remember that, although we always used ASCII 
  2030.           characters for return values in the example, ANY character or integer
  2031.           value, in the range of 1 to 65534, can be used.
  2032.  
  2033.  
  2034.  
  2035.  
  2036.  
  2037.  
  2038.  
  2039.  
  2040.  
  2041.  
  2042.  
  2043.  
  2044.  
  2045.  
  2046.  
  2047.  
  2048.  
  2049.  
  2050.  
  2051.  
  2052.  
  2053.  
  2054.  
  2055.  
  2056.  
  2057.  
  2058.  
  2059.  
  2060.  
  2061.  
  2062.  
  2063.  
  2064.  
  2065.  
  2066.  
  2067.  
  2068.  
  2069.  
  2070.  
  2071.  
  2072.  
  2073.  
  2074.  
  2075.  
  2076.  
  2077.  
  2078.  
  2079.  
  2080.  
  2081.  
  2082.                                         - Page 34 -
  2083.  
  2084.  
  2085.  
  2086.  
  2087.  
  2088.                                                       MouseTrap Library, Rel 1.01
  2089.                                                                 February 12, 1989
  2090.  
  2091.  
  2092.                        Chapter 5
  2093.  
  2094.                                        Technical Specification
  2095.  
  2096.                This chapter is provided only to those who have paid to become 
  2097.           registered uses.  This was done because I assumed that it would be  of
  2098.           little use to anyone who didn't have the source code (which also comes
  2099.           with registration). This method also gives me a few extra weeks to
  2100.           write it.
  2101.  
  2102.  
  2103.  
  2104.  
  2105.  
  2106.  
  2107.  
  2108.  
  2109.  
  2110.  
  2111.  
  2112.  
  2113.  
  2114.  
  2115.  
  2116.  
  2117.  
  2118.  
  2119.  
  2120.  
  2121.  
  2122.  
  2123.  
  2124.  
  2125.  
  2126.  
  2127.  
  2128.  
  2129.  
  2130.  
  2131.  
  2132.  
  2133.  
  2134.  
  2135.  
  2136.  
  2137.  
  2138.  
  2139.  
  2140.  
  2141.  
  2142.  
  2143.  
  2144.                                         - Page 35 -
  2145.  
  2146.  
  2147.  
  2148.  
  2149.  
  2150.                                                       MouseTrap Library, Rel 1.01
  2151.                                                                 February 12, 1989
  2152.  
  2153.  
  2154.                        Chapter 6
  2155.  
  2156.                                        Appendix
  2157.  
  2158.  
  2159.  
  2160.                                A.      MOUSTRAP.H
  2161.                                B.      Global Variables
  2162.                                C.      Error Codes
  2163.                                D.      Reference
  2164.                                E.      Support
  2165.                                F.      Release History
  2166.  
  2167.  
  2168.  
  2169.  
  2170.  
  2171.  
  2172.  
  2173.  
  2174.  
  2175.  
  2176.  
  2177.  
  2178.  
  2179.  
  2180.  
  2181.  
  2182.  
  2183.  
  2184.  
  2185.  
  2186.  
  2187.  
  2188.  
  2189.  
  2190.  
  2191.  
  2192.  
  2193.  
  2194.  
  2195.  
  2196.  
  2197.  
  2198.  
  2199.  
  2200.  
  2201.  
  2202.  
  2203.  
  2204.  
  2205.  
  2206.                                         - Page 36 -
  2207.  
  2208.  
  2209.  
  2210.  
  2211.  
  2212.                                                       MouseTrap Library, Rel 1.01
  2213.                                                                 February 12, 1989
  2214.  
  2215.                        Appendix A  :   MOUSTRAP.H
  2216.  
  2217.  
  2218.                The  header file,  MOUSTRAP.H should be included in every C
  2219.           program which uses the MouseTrap Library functions.  It includes
  2220.           complete function prototypes for each of the MouseTrap Library functions. 
  2221.           In addition, it defines a number of constants which are to be used
  2222.           with the functions.  These include:
  2223.  
  2224.                M_Overlaid_Pages    -and-    M_Single_Pages,  which are used      
  2225.                with the function Define_Mouse_System.
  2226.  
  2227.                M_Text_Coord -and- M_Graphic_Coord,  which are used with the      
  2228.                Add_Mouse_Page function, to tell which system screen coordinates
  2229.                are being given in.
  2230.  
  2231.                M_Left, M_Right, M_Center, -and- M_Middle, which are used to
  2232.                refer to the mouse buttons whenever necessary. Note that M_Center
  2233.                and  M_Middle are equivalent, and you may use whichever holds 
  2234.                your fancy.
  2235.  
  2236.                M_HORIZ -and- M_VERT, which are used with Set_Mouse_Limits.
  2237.  
  2238.                MERROR -and- MNOERROR, (-1 and 0,  respectively),  which are
  2239.                return by various functions to indicate whether an  error 
  2240.                occurred.  Also defined are a large number of error codes, which
  2241.                are discussed further in appendix C.
  2242.  
  2243.                     The macro TC() is used to create an integer value in the form
  2244.                BFCC, where B is the background color, F, the foreground color,   
  2245.                and CC is a character.  This value is used by Set_Mouse_Text_Cursor, 
  2246.                (and  by  other  routines  outside of the  MouseTrap  Library
  2247.                which perform  direct screen writes).   The macro require that you
  2248.                give it the character,  foreground and background color code.  The
  2249.                statement TC('A',14,5) would produce the code 5E41h, which mean
  2250.                the letter 'A' in bright Yellow on a Magenta background.
  2251.  
  2252.                     It also declared three global variables, which are described
  2253.                in Appendix B.
  2254.  
  2255.                Also defined is the data type "mouse_t" which is used to define
  2256.                vitually every variable used in the  MouseTrap  functions. Also
  2257.                included are the structure definitions for Pages, buttons, and   
  2258.                hot spots.  I'll not should what you can use them for, but I
  2259.                thought you might be interested.
  2260.  
  2261.                The last group of lines will"force" LINK to include the proper 
  2262.                version of the MouseTrap library, without being explicitly told 
  2263.                to.  This will only work with Microsoft C 5.1.  Other compliers
  2264.                will probable generate a warning for these lines.
  2265.  
  2266.  
  2267.  
  2268.                                         - Page 37 -
  2269.  
  2270.  
  2271.  
  2272.  
  2273.  
  2274.                                                       MouseTrap Library, Rel 1.01
  2275.                                                                 February 12, 1989
  2276.  
  2277.                        Appendix B  :   Global Variables
  2278.  
  2279.                        
  2280.                There  are  three global variables used with  the  MouseTrap
  2281.           Function.  They are:
  2282.  
  2283.                _mouse_there:   This is initialized to 0, meaning no mouse
  2284.                     available, and is set by calling either Check_Mouse or
  2285.                     Define_Mouse_System.  After a call to either of those
  2286.                     functions it is set to either 0, meaning that there is STILL
  2287.                     no mouse on this system, or, 2 or 3, giving the number of
  2288.                     buttons on the mouse. Since "no mouse" is zero,  and "mouse
  2289.                     present" is nonzero, this variable can also be used as a
  2290.                     TRUE/FALSE value.
  2291.  
  2292.                M_Paging_Method: This simply holding the value you used with  
  2293.                     Define_Mouse_System, and is either M_Overlaid_Pages or  
  2294.                     M_Single_Pages.
  2295.  
  2296.                M_Error: This holds the error code of the last error that occurred.
  2297.                     Full description of the error codes is given in Appendix C.
  2298.  
  2299.                And, there are three predefined graphic cursors:
  2300.  
  2301.                     Lightening  :  A Lightening Bolt, use hot spot
  2302.                     PeaceSign   :  A peace sign. use hot spot.
  2303.                     CrossHair   :  A cross hair, use hot spot
  2304.  
  2305.  
  2306.  
  2307.  
  2308.  
  2309.  
  2310.  
  2311.  
  2312.  
  2313.  
  2314.  
  2315.  
  2316.  
  2317.  
  2318.  
  2319.  
  2320.  
  2321.  
  2322.  
  2323.  
  2324.  
  2325.  
  2326.  
  2327.  
  2328.  
  2329.  
  2330.                                         - Page 38 -
  2331.  
  2332.  
  2333.  
  2334.  
  2335.  
  2336.                                                       MouseTrap Library, Rel 1.01
  2337.                                                                 February 12, 1989
  2338.  
  2339.                                Appendix C   :  Error Codes.
  2340.  
  2341.                Error  conditions are indicated by a function returning the value 
  2342.           MERROR (-1)  with the error code given in the global variable M_Error. 
  2343.           The error code remains in M_Error until either cleared manually by the
  2344.           user or altered by another error.
  2345.  
  2346.                        The error code are:
  2347.  
  2348.                MNOINIT        An attempt  was made to use one of the advanced functions
  2349.                               without first calling Define_Mouse_System
  2350.  
  2351.                NOMOUSE        An attempt was made to use a function while no
  2352.                               mouse was attached to the system.
  2353.  
  2354.                NOSPACE        An attempt to add a new Page,  Button, or hot 
  2355.                               spot failed  because there was not enough available 
  2356.                               RAM.  Since  these definitions use so little
  2357.                               memory, this error should rarely occur.
  2358.  
  2359.                MTOOMANY       An attempt was made to define more than 16 pages
  2360.                               in Overlaid  mode,  or more than 65536 pages in 
  2361.                               single page  mode,  or more than 65536 hot spots
  2362.                               (in either mode).  Remember,  that all hot spots
  2363.                               defined, even those later deleted, count  towards 
  2364.                               this limit.  (Deleted pages, however, do not.)
  2365.  
  2366.                MNOREINIT      An attempt was made to  call  Define_Mouse_System, 
  2367.                               after pages were added. All pages (and buttons, 
  2368.                               and hot spots)  must be removed before a second
  2369.                               call to Define_Mouse_System may be made.
  2370.                               Use Clear_All_Mouse_Definitions().
  2371.  
  2372.                MNOTPAGE       An attempt was made to reference a page which had  
  2373.                               not yet been defined.
  2374.  
  2375.                MNOTBUTTON     An attempt was made to reference a button which had 
  2376.                               not yet been defined.
  2377.  
  2378.                MNOTHOTSPOT    An attempt was made to reference a hot spot which  
  2379.                               had not yet been defined.
  2380.  
  2381.                MBUTTONRET     An attempt was made to tied a hot spot to button   
  2382.                               which already has it's own return value.
  2383.  
  2384.                MNOACTIVE      An attempt was made to call Read_Mouse with no page 
  2385.                               active.
  2386.  
  2387.            -----------
  2388.                NOTE:     The  MouseTrap  library does not display any form of 
  2389.                error message.  The only way it alerts you that it feels something
  2390.                has gone awry is throught these flags.
  2391.  
  2392.                                         - Page 39 -
  2393.  
  2394.  
  2395.  
  2396.  
  2397.  
  2398.                                                       MouseTrap Library, Rel 1.01
  2399.                                                                 February 12, 1989
  2400.  
  2401.  
  2402.  
  2403.  
  2404.  
  2405.  
  2406.  
  2407.  
  2408.  
  2409.  
  2410.  
  2411.  
  2412.  
  2413.  
  2414.  
  2415.  
  2416.  
  2417.  
  2418.  
  2419.  
  2420.  
  2421.  
  2422.  
  2423.  
  2424.  
  2425.  
  2426.  
  2427.  
  2428.  
  2429.  
  2430.  
  2431.  
  2432.  
  2433.  
  2434.  
  2435.  
  2436.  
  2437.  
  2438.  
  2439.  
  2440.  
  2441.  
  2442.  
  2443.  
  2444.  
  2445.  
  2446.  
  2447.  
  2448.  
  2449.  
  2450.  
  2451.  
  2452.  
  2453.  
  2454.                                         - Page 40 -
  2455.  
  2456.  
  2457.  
  2458.  
  2459.  
  2460.                                                       MouseTrap Library, Rel 1.01
  2461.                                                                 February 12, 1989
  2462.  
  2463.                                  Appendix D  :   Reference
  2464.  
  2465.                Much of the information used to create this manual was taken from:
  2466.  
  2467.                Mouse System Corporation,  Optimouse Reference Manual, 
  2468.                     version 4.0, Copyright 1984, 1985.
  2469.  
  2470.                Cort, Nigel. "How to Handle a Mouse,  part 1."  The C Gazette.
  2471.                     2:4, March 1988.
  2472.  
  2473.                Cort, Nigel. "How to Handle a Mouse,  part 2."  The C Gazette.
  2474.                     3:1, Summer 1988.
  2475.  
  2476.  
  2477.  
  2478.  
  2479.  
  2480.  
  2481.  
  2482.  
  2483.  
  2484.  
  2485.  
  2486.  
  2487.  
  2488.  
  2489.  
  2490.  
  2491.  
  2492.  
  2493.  
  2494.  
  2495.  
  2496.  
  2497.  
  2498.  
  2499.  
  2500.  
  2501.  
  2502.  
  2503.  
  2504.  
  2505.  
  2506.  
  2507.  
  2508.  
  2509.  
  2510.  
  2511.  
  2512.  
  2513.  
  2514.  
  2515.  
  2516.                                         - Page 41 -
  2517.  
  2518.  
  2519.  
  2520.  
  2521.  
  2522.                                                       MouseTrap Library, Rel 1.01
  2523.                                                                 February 12, 1989
  2524.  
  2525.                                   Appendix E   :  Support
  2526.  
  2527.                James  M.  Curran  is the author of the MouseTrap Functions and
  2528.           is solely responsible for it's content.  Any comments, problem,
  2529.           suggestions, marriage proposals, or death threats stemming from this   
  2530.           library should be directed to him at:
  2531.                                         James M. Curran
  2532.                                         24 Greendale Road
  2533.                                         Cedar Grove, NJ 07009-1313
  2534.  
  2535.                Don't forget the "M."  since the family is just swarming with
  2536.           "James Curran"'s
  2537.                        
  2538.                He can also be reached via Compuserve at [72261,655].
  2539.  
  2540.                And  for  the  more  adventurous,  he's also a regular on several 
  2541.           northern New Jersey BBS's under the handle "The Perfect Stranger"
  2542.  
  2543.  
  2544.                Special Note for version 1.0: Because of the painfully short time
  2545.           between the original inspiration for this, and my leaving on a European 
  2546.           trip (which, I assume will do much to help me forget said pain), this
  2547.           entire project was written, debugged, and documented in 10 days (while
  2548.           still working at the day job).  Obviously, there HAS to be some bugs
  2549.           lurking out there somewhere, if not in the functions themselves, in 
  2550.           this documentation (there are, by the way, three functions in the
  2551.           library that are not described here).  Any feedback from users will be
  2552.           of great assistance in putting out version  1.1 when I get back.
  2553.  
  2554.  
  2555.  
  2556.  
  2557.  
  2558.  
  2559.  
  2560.  
  2561.  
  2562.  
  2563.  
  2564.  
  2565.  
  2566.  
  2567.  
  2568.  
  2569.  
  2570.  
  2571.  
  2572.  
  2573.  
  2574.  
  2575.  
  2576.  
  2577.  
  2578.                                         - Page 42 -
  2579.  
  2580.  
  2581.  
  2582.  
  2583.  
  2584.                                                       MouseTrap Library, Rel 1.01
  2585.                                                                 February 12, 1989
  2586.  
  2587.                              Appendix F   :  Revision History
  2588.  
  2589.  
  2590.                9/21/88: Original Release! 
  2591.  
  2592.                10/22/88:  Revision  1.01:  Corrected  typo's and clarified areas 
  2593.                     of the documentation.  Rewrote the Set_Mouse_Limits function.
  2594.                     Finally  documented Get_Mickeys,  and Set_Mouse_Graphic_Cursor, 
  2595.                     and added the sample cursors (Peace, Lightening, CrossHair).
  2596.                     Eventually wrote Chapter 5.
  2597.  
  2598.                2/89 : Converted documentation to WordPerfect. (May actually be
  2599.                     updated in a timely fashion now) Corrected Table of Contents,
  2600.                     and added Index, and did all kinds of things one can do when
  2601.                     I finally gets a REAL word processor. (Note how I carefull
  2602.                     avoid slandering my last word processor).
  2603.  
  2604.  
  2605.  
  2606.  
  2607.  
  2608.  
  2609.  
  2610.  
  2611.  
  2612.  
  2613.  
  2614.  
  2615.  
  2616.  
  2617.  
  2618.  
  2619.  
  2620.  
  2621.  
  2622.  
  2623.  
  2624.  
  2625.  
  2626.  
  2627.  
  2628.  
  2629.  
  2630.  
  2631.  
  2632.  
  2633.  
  2634.  
  2635.  
  2636.  
  2637.  
  2638.  
  2639.  
  2640.                                         - Page 43 -
  2641.  
  2642.  
  2643.  
  2644.  
  2645.  
  2646.                                                       MouseTrap Library, Rel 1.01
  2647.                                                                 February 12, 1989
  2648.  
  2649.  
  2650.                                     Appendix I : Index
  2651.  
  2652.  
  2653.           Activate_Mouse_Page()  . . . . . . . . . . . . . . . . . . . . . . . 16
  2654.           Add_Mouse_Button() . . . . . . . . . . . . . . . . . . . . . . . . . 16
  2655.           Add_Mouse_Hot_Spot() . . . . . . . . . . . . . . . . . . . . . . . . 16
  2656.           Add_Mouse_Page() . . . . . . . . . . . . . . . . . . . . . . . . . . 16
  2657.           Check_Mouse()  . . . . . . . . . . . . . . . . . . . . .  4-7, 9-11, 14
  2658.           Clear_All_Mouse_Definition() . . . . . . . . . . . . . . . . . . . . 16
  2659.           Clear_Mouse_Pages()  . . . . . . . . . . . . . . . . . . . . . . . . 16
  2660.           DeActivate_Mouse_Page()  . . . . . . . . . . . . . . . . . . . . . . 16
  2661.           Define_Mouse_System()  . . . . . . . . . . . . . . . . . . . . .  5, 16
  2662.           Delete_Mouse_Button()  . . . . . . . . . . . . . . . . . . . . . . . 16
  2663.           Delete_Mouse_Hot_Spot()  . . . . . . . . . . . . . . . . . . . . . . 16
  2664.           Delete_Mouse_Page()  . . . . . . . . . . . . . . . . . . . . . . . . 16
  2665.           Functions  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
  2666.           Get_Char_Mouse_Kbd() . . . . . . . . . . . . . . . . . . 16, 29, 31, 32
  2667.           Get_Mouse_Position()       . . . . . . . . . . . . . . . . . . . . .  4
  2668.           Get_Mouse_Press()  . . . . . . . . . . . . . . . . . . . . . . . . .  4
  2669.           Get_Mouse_Release()  . . . . . . . . . . . . . . . . . . . . . . . .  4
  2670.           Hide_Mouse() . . . . . . . . . . . . . . . . . . . . . . . . . . . 4, 6
  2671.           Read_Mouse()   . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
  2672.           Set_Mouse_Limits()   . . . . . . . . . . . . . . . . . . . . . . . .  4
  2673.           Set_Mouse_Position()       . . . . . . . . . . . . . . . . . . . . .  4
  2674.           Set_Mouse_Text_Cursor()  . . . . . . . . . . . . . . . . . . . . . .  4
  2675.           Show_Mouse() . . . . . . . . . . . . . . . . . . . . . . . . .  4, 6, 9
  2676.           Activate_Mouse_Page()  . . . . . . . . . . . . . . . . . . . . . . . 16
  2677.           Add_Mouse_Button() . . . . . . . . . . . . . . . . . . . . . . . . . 16
  2678.           Add_Mouse_Hot_Spot() . . . . . . . . . . . . . . . . . . . . . . . . 16
  2679.           Add_Mouse_Page() . . . . . . . . . . . . . . . . . . . . . . . . . . 16
  2680.           Check_Mouse()  . . . . . . . . . . . . . . . . . . . . .  4-7, 9-11, 14
  2681.           Clear_All_Mouse_Definition() . . . . . . . . . . . . . . . . . . . . 16
  2682.           Clear_Mouse_Pages()  . . . . . . . . . . . . . . . . . . . . . . . . 16
  2683.           DeActivate_Mouse_Page()  . . . . . . . . . . . . . . . . . . . . . . 16
  2684.           Define_Mouse_System()  . . . . . . . . . . . . . . . . . . . . .  5, 16
  2685.           Delete_Mouse_Button()  . . . . . . . . . . . . . . . . . . . . . . . 16
  2686.           Delete_Mouse_Hot_Spot()  . . . . . . . . . . . . . . . . . . . . . . 16
  2687.           Delete_Mouse_Page()  . . . . . . . . . . . . . . . . . . . . . . . . 16
  2688.           Functions  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
  2689.           Get_Char_Mouse_Kbd() . . . . . . . . . . . . . . . . . . 16, 29, 31, 32
  2690.           Get_Mouse_Position()       . . . . . . . . . . . . . . . . . . . . .  4
  2691.           Get_Mouse_Press()  . . . . . . . . . . . . . . . . . . . . . . . . .  4
  2692.           Get_Mouse_Release()  . . . . . . . . . . . . . . . . . . . . . . . .  4
  2693.           Hide_Mouse() . . . . . . . . . . . . . . . . . . . . . . . . . . . 4, 6
  2694.           Read_Mouse()   . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
  2695.           Set_Mouse_Limits()   . . . . . . . . . . . . . . . . . . . . . . . .  4
  2696.           Set_Mouse_Position()       . . . . . . . . . . . . . . . . . . . . .  4
  2697.           Set_Mouse_Text_Cursor()  . . . . . . . . . . . . . . . . . . . . . .  4
  2698.           Show_Mouse() . . . . . . . . . . . . . . . . . . . . . . . . .  4, 6, 9
  2699.  
  2700.  
  2701.  
  2702.                                         - Page 44 -
  2703.  
  2704.