moustrap.prn

来自「又一个关于鼠标驱动的C程序」· PRN 代码 · 共 2,261 行 · 第 1/5 页

PRN
2,261
字号



                                                      MouseTrap Library, Rel 1.01
                                                                February 12, 1989

                               Chapter 3
                                       Advanced Mouse Control Functions


                    These thirteen functions simplify the process of interpreting
                    the users input using a mouse.  They work on the assumption
                    that most of the time a mouse is used by "clicking" a
                    specific button at a specific place on the screen. They were
                    written using Microsoft's C v5.1.  


                       Activate_Mouse_Page()
                       Add_Mouse_Button()
                       Add_Mouse_Hot_Spot()
                       Add_Mouse_Page()
                       Clear_All_Mouse_Definition()
                       Clear_Mouse_Pages()
                       DeActivate_Mouse_Page()
                       Define_Mouse_System()
                       Delete_Mouse_Button()
                       Delete_Mouse_Hot_Spot()
                       Delete_Mouse_Page()
                       Get_Char_Mouse_Kbd()
                       Read_Mouse() 
                       Read_Mouse_Kbd()




























                                        - Page 16 -





                                                      MouseTrap Library, Rel 1.01
                                                                February 12, 1989

                                    Activate_Mouse_Page
                  
               Syntax:
                    #include <moustrap.h>
                    mouse_t Activate_Mouse_Page(mouse_t Page_ID)

               Description:
                         The Activate_Mouse_Page function sets active one of the 
                    previously defined mouse pages.  In Single Page mode, the
                    currently active page is cleared, and the mouse cursor is
                    limited to the area of that page. In Overlaid mode, the current
                    pages remain active, and the mouse cursor area is widened, if
                    necessary, to accommodate the new page.

               Return Value:
                    MNOERROR if there was no problem, otherwise
                    MERROR with M_Error set to the specific error.

               See Also:
                    M_Error, DeActivate_Mouse_Page, Add_Mouse_Page

               Example:

                       See Chapter 4.





























                                        - Page 17 -





                                                      MouseTrap Library, Rel 1.01
                                                                February 12, 1989

                                      Add_Mouse_Page
               Syntax:
                    #include <moustrap.h>

                    mouse_t Add_Mouse_Page(Page_Type, Top, Left, Bottom, Right);

                    mouse_t         Page_Type;      /* M_Text_Coord    or  */    
                                                    /* M_Graphic_Coord     */    
                    mouse_t         Top;
                    mouse_t         Left;           /* Coordinates of corners */ 
                    mouse_t         Bottom;         /* of the page.           */ 
                    mouse_t         Right; 

               Description:
                         Defines a new mouse page which is added  to  the 
                    system.  Page_Type tells if the corner points are given using
                    text coordinates (80x25) or Graphic coordinates (640x200).
                    Coordinates of Hot Spots for this page are also assumed to
                    be given using that system.

               Return Value:
                         Returns a Page ID number, which is to be used to
                    reference  this page in the future, or, MERROR if there was a
                    problem,  with it's cause given in M_Error. 

               See Also:
                    Delete_Mouse_Page, Add_Mouse_Button, Add_Mouse_Hot_Spot      
                    M_Error, Activate_Mouse_Page, DeActivate_Mouse_Page     

               Example:

                    See Chapter 4.





















                                        - Page 18 -





                                                      MouseTrap Library, Rel 1.01
                                                                February 12, 1989

                                     Add_Mouse_Button
               Syntax:
                    #include <moustrap.h>

                    mouse_t Add_Mouse_Button(Page_ID, Button, Return_Value);
                    mouse_t Page_ID;
                    mouse_t Button;
                    mouse_t Return_Value;
                       
               Description:
                         Add_Mouse_Button  lets you tell the system how to react
                    to a certain button being pressed.  Page_ID is the page
                    which this definition refers to, or if 0, the definition is
                    valid in all pages.  Button is either M_Left, M_Right, or
                    M_Center.  If the Return_Value is 0, it's assumed the Hot
                    Spots are associated with this button in this page. Otherwise,
                    the Return_Value is any value the user wished to assign. 
                    It's return by Read_Mouse and Get_Char_Mouse_Kbd if that
                    button is pressed while that page is active.  In Overlaid
                    mode, if more than one page, with conflicting definitions,
                    are active the most recent Add_Mouse_Button has precedence. 
                    Any definition of a particular Page/Button combination
                    replaces any previous definition of that combination.
                
               Return Value:
                    MNOERROR if there was no problem; otherwise
                    MERROR with the specific error given in M_Error

               See Also
                    M_Error, Add_Mouse_Page, Add_Mouse_Hot_Spot

               Example:
                    See Chapter 4.




















                                        - Page 19 -





                                                      MouseTrap Library, Rel 1.01
                                                                February 12, 1989

                                    Add_Mouse_Hot_Spot
               Syntax:
                    #include <moustrap.h>
                       
                    mouse_t Add_Mouse_Hot_Spot(Page_ID, Button, Top, Left,       
                                           Bottom, Right, Return_Value);         
                    mouse_t Page_ID;
                    mouse_t Button;
                    mouse_t Top;            /* corner of the area */
                    mouse_t Left;
                    mouse_t Bottom;
                    mouse_t Right;
                    mouse_t Return_Value;

               Description:
                         Add_Mouse_Hot_Spot defines an area such that if the     
                    appropriate Button is pressed while the mouse cursor is
                    within the area given while the page given by Page_ID is 
                    active, Read_Mouse will return Return_Value. A  maximum of
                    65535 hot spots can be defined.

               Return Value:
                         An  ID  number for this hot spot,  if there was no
                    problem; otherwise MERROR with the specific error given in M_Error.
                       
               See Also:
                    M_Error, Delete_Mouse_Hot_Spot

               Example:
                    See Chapter 4.
                    






















                                        - Page 20 -





                                                      MouseTrap Library, Rel 1.01
                                                                February 12, 1989

                                Clear_All_Mouse_Definitions
               Syntax:
                    #include <moustrap.h>
                       
                    mouse_t Clear_All_Mouse_Definitions(void);

               Description:
                         Erases everything.  Removes all Page,  Button,  and Hot
                    Spot definitions. Reset various internal variables.  Must be
                    done before switching between Single Page & Overlaid modes.

               Return Value:
                    MNOERROR if there was no problem; otherwise
                    MERROR with the specific error given in M_Error
                     
               See Also:
                    M_Error, Define_Mouse_System

               Example:
                    See Chapter 4.
                    
































                                        - Page 21 -





                                                      MouseTrap Library, Rel 1.01
                                                                February 12, 1989

                                     Clear_Mouse_Pages
               Syntax:
                    #include <moustrap.h>

                    mouse_t Clear_Mouse_Pages(void);
                       
               Description:
                         Deactivates  all mouse pages.  Hides cursors.  Resets
                    cursor limits.

               Return Value:
                    MNOERROR if there was no problem; otherwise
                    MERROR with the specific error given in M_Error
                       
               See Also:
                    M_Error, DeActivate_Mouse_Page, Activate_Mouse_Cursor

               Example:
                    See Chapter 4.


































                                        - Page 22 -





                                                      MouseTrap Library, Rel 1.01
                                                                February 12, 1989

                                   DeActivate_Mouse_Page
               Syntax:
                    #include <moustrap.h>

                    mouse_t DeActivate_Mouse_Page(Page_ID);
                    mouse_t Page_ID;
                       
               Description:
                    Deactivates the referenced mouse page.  Button and Hot Spot 
                    definitions linked to that page will no longer function until 
                    restarted with Activate_Mouse_Page.  On Single page mode, 
                    this is done automatically when another page is activated.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?