home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 31
/
CDASC_31_1996_juillet_aout.iso
/
vrac
/
multikit.zip
/
MOUSE.DOC
< prev
next >
Wrap
Text File
|
1996-03-01
|
5KB
|
123 lines
Documentation ─────────────────────────────────────────────────────────────┐
│ Mouse Handler │
└───────────────────────────────────────────────────────────── MULTIKIT v1.0
Since XMODE is a graphics mode I've designed by changing internal registers
of the VGA card the BIOS support is no longer present. That means you can't
use the INT 10h service routines (excluding the palette operations) and the
mouse service INT 33h won't work properly. If you want to use the mouse
within XMODE you must use this unit. Please read the following instructions
before linking the unit into your program:
(1) Once you've installed the mouse within MOUSE.TPU by using MOUSEINIT
you are not allowed to access the INT 33h. Your program would probably
crash and your PC hangs.
(2) Before you do any graphic actions you must hide oder freeze the mouse
cursor. If don't do that and the user moves the mouse and/or presses a
mouse button while you draw something on your screen the handler modi-
fies the VGA registers to move the mouse cursor. The result is unpre-
dictable drawing behavior because of the modified registers which are
not preserved by the handler.
(3) The mouse cursor is simply a sprite, clipped at right and/or bottom if
neccessary. To ensure high speed the background of the mouse cursor is
copied into the last 42 Bytes of the VRAM. Remember that the backgrnd
must be restored and saved any time the mouse is moved. This is syn-
chronized to the vertical retrace period.
Global constants and variables:
───────────────────────────────
The following types, constants and variables are exported. You should use
the exported procedures to change them and not do that directly.
Const constants for the mouse type which is
Bus = 1; holded by MOUSEINFO.WHICH
Serial = 2;
InPort = 3;
PS2 = 4;
HP = 5;
MouseMask: Array[1..14] Of Byte the default mouse cursor
Var
MouseInfo: Record general information about the mouse
Version: Word; - mouse drivers' version
Buttons: Byte; - number of buttons
Which: Byte; - type of mouse
IRQ: Byte; - IRQ channel
End;
MouseDefs: Record appearence of the mouse cursor
Mask: Array[1..1344] Of Byte; - internal cursor definition
Color: Byte; - cursor color
Hidden: Byte; - hidden flag
Frozen: Byte; - frozen flag
End;
MouseActs: Record current mouse status
LeftPressed, - left key pressed
MiddPressed, - middle key pressed
RghtPressed: Boolean; - right key pressed
XPos, YPos: Word; - onscreen position
End;
MouseBack: Record mouse background data
Backgrnd: Pointer; - points to the last 42 bytes of VRAM
ScrnOffs: Word; - old page offset
XPos: Word; - old horizontal position
YPos: Word; - old vertical position
End;
Public procedures and functions
───────────────────────────────
Function MouseInit: Boolean;
Initialize the mouse driver functions and install the mouse event
handler. This is the first function you must call before using
any of the mouse functions. This mouse code uses the fastest pos-
sible techniques to save and restore mouse backgrounds and to
draw the mouse cursor. Returns FALSE if no mouse driver found.
Procedure MouseDone;
Stops the internal event handler. This will remove the mouse con-
trol. Call this procedure before exiting your program.
Procedure MouseShow;
Shows the mouse cursor on the screen. After initing the mouse or
when you've called MOUSEHIDE the mouse won't appear on the screen
and you can show it again by calling this procedure.
Procedure MouseHide;
Hides the mouse cursor. IMPORTANT: see (2). Though the cursor is
not visible the coordinates and current key status are placed in-
to MOUSEACTS.
Procedure MouseDefine(Var Mask; Color: Byte);
Defines the mouse cursor shape which size is always 8x14. You can
use FONTEDIT to create your own mouse cursor.
Procedure MouseWindow(X1, Y1, X2, Y2: Word);
Defines boundaries for the mouse cursor. You can't move the cur-
sor out of the window.
Procedure MousePosition(X, Y: Word);
Move the mouse to a specific screen position X,Y.
This unit is part of MULTIKIT.
(C) Copyright by TSC-Software, 1996.