home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 31 / CDASC_31_1996_juillet_aout.iso / vrac / multikit.zip / MOUSE.DOC < prev    next >
Text File  |  1996-03-01  |  5KB  |  123 lines

  1.  
  2.  Documentation ─────────────────────────────────────────────────────────────┐
  3.  │                               Mouse Handler                              │
  4.  └───────────────────────────────────────────────────────────── MULTIKIT v1.0
  5.  
  6.  
  7.  
  8.  Since XMODE is a graphics mode I've designed by changing internal registers
  9.  of the VGA card the BIOS support is no longer present. That means you can't
  10.  use the INT 10h service routines (excluding the palette operations) and the
  11.  mouse service INT 33h won't work properly. If you want  to  use  the  mouse
  12.  within XMODE you must use this unit. Please read the following instructions
  13.  before linking the unit into your program:
  14.  
  15.   (1) Once you've installed the mouse within MOUSE.TPU  by  using  MOUSEINIT
  16.       you are not allowed to access the INT 33h. Your program would probably
  17.       crash and your PC hangs.
  18.  
  19.   (2) Before you do any graphic actions you must hide oder freeze the  mouse
  20.       cursor. If don't do that and the user moves the mouse and/or presses a
  21.       mouse button while you draw something on your screen the handler modi-
  22.       fies the VGA registers to move the mouse cursor. The result is  unpre-
  23.       dictable drawing behavior because of the modified registers which  are
  24.       not preserved by the handler.
  25.  
  26.   (3) The mouse cursor is simply a sprite, clipped at right and/or bottom if
  27.       neccessary. To ensure high speed the background of the mouse cursor is
  28.       copied into the last 42 Bytes of the VRAM. Remember that the  backgrnd
  29.       must be restored and saved any time the mouse is moved. This  is  syn-
  30.       chronized to the vertical retrace period.
  31.  
  32.  
  33.  
  34.  
  35.  Global constants and variables:
  36.  ───────────────────────────────
  37.  The following types, constants and variables are exported. You  should  use
  38.  the exported procedures to change them and not do that directly.
  39.  
  40.  
  41.  Const                                constants for the mouse type which  is
  42.   Bus    = 1;                         holded by MOUSEINFO.WHICH
  43.   Serial = 2;
  44.   InPort = 3;
  45.   PS2    = 4;
  46.   HP     = 5;
  47.  
  48.   MouseMask: Array[1..14] Of Byte     the default mouse cursor
  49.  
  50.  
  51.  Var
  52.   MouseInfo: Record                   general information about the mouse
  53.    Version:  Word;                    - mouse drivers' version
  54.    Buttons:  Byte;                    - number of buttons
  55.    Which:    Byte;                    - type of mouse
  56.    IRQ:      Byte;                    - IRQ channel
  57.   End;
  58.  
  59.   MouseDefs: Record                   appearence of the mouse cursor
  60.    Mask:     Array[1..1344] Of Byte;  - internal cursor definition
  61.    Color:    Byte;                    - cursor color
  62.    Hidden:   Byte;                    - hidden flag
  63.    Frozen:   Byte;                    - frozen flag
  64.   End;
  65.  
  66.   MouseActs: Record                   current mouse status
  67.    LeftPressed,                       - left key pressed
  68.    MiddPressed,                       - middle key pressed
  69.    RghtPressed: Boolean;              - right key pressed
  70.    XPos,  YPos: Word;                 - onscreen position
  71.   End;
  72.  
  73.   MouseBack: Record                   mouse background data
  74.    Backgrnd: Pointer;                 - points to the last 42 bytes of VRAM
  75.    ScrnOffs: Word;                    - old page offset
  76.    XPos:     Word;                    - old horizontal position
  77.    YPos:     Word;                    - old vertical position
  78.   End;
  79.  
  80.  
  81.  
  82.  
  83.  Public procedures and functions
  84.  ───────────────────────────────
  85.  
  86.  Function  MouseInit: Boolean;
  87.            Initialize the mouse driver functions and install the mouse event
  88.            handler. This is the first function you must  call  before  using
  89.            any of the mouse functions. This mouse code uses the fastest pos-
  90.            sible techniques to save and restore  mouse  backgrounds  and  to
  91.            draw the mouse cursor. Returns FALSE if no mouse driver found.
  92.  
  93.  Procedure MouseDone;
  94.            Stops the internal event handler. This will remove the mouse con-
  95.            trol. Call this procedure before exiting your program.
  96.  
  97.  Procedure MouseShow;
  98.            Shows the mouse cursor on the screen. After initing the mouse  or
  99.            when you've called MOUSEHIDE the mouse won't appear on the screen
  100.            and you can show it again by calling this procedure.
  101.  
  102.  Procedure MouseHide;
  103.            Hides the mouse cursor. IMPORTANT: see (2). Though the cursor  is
  104.            not visible the coordinates and current key status are placed in-
  105.            to MOUSEACTS.
  106.  
  107.  Procedure MouseDefine(Var Mask; Color: Byte);
  108.            Defines the mouse cursor shape which size is always 8x14. You can
  109.            use FONTEDIT to create your own mouse cursor.
  110.  
  111.  Procedure MouseWindow(X1, Y1, X2, Y2: Word);
  112.            Defines boundaries for the mouse cursor. You can't move the  cur-
  113.            sor out of the window.
  114.  
  115.  Procedure MousePosition(X, Y: Word);
  116.            Move the mouse to a specific screen position X,Y.
  117.  
  118.  
  119.  
  120.  This unit is part of MULTIKIT.  
  121.  (C) Copyright by TSC-Software, 1996.
  122.  
  123.