home *** CD-ROM | disk | FTP | other *** search
Modula Definition | 1988-12-23 | 2.5 KB | 86 lines |
- (***********************************************)
- (* MOUSE.DEF *)
- (* Maus-Modul für TopSpeed Modula 2 *)
- (* (C) 1988 M.Schlöter & TOOLBOX *)
-
- DEFINITION MODULE Mouse;
-
- FROM SYSTEM IMPORT WORD;
-
- CONST (* Constants for comparison which *)
- (* mouse-button has been pressed *)
- MLButton = 0;
- MRButton = 1;
-
- TYPE tMMasks = RECORD (* mouse-pointer bitmasks *)
- screen, mask : ARRAY[0..15] OF WORD;
- END;
-
- VAR MArrow : tMMasks;
- (* contains graphic mouse-pointer *)
-
- PROCEDURE CheckM() : INTEGER;
- (* Returns # of mouse-buttons or 0 if no mouse *)
- (* REMEMBER: Microsoft kompatible mouses always *)
- (* return 1 button, but have realy 2 *)
-
- PROCEDURE MButtonPressed() : BOOLEAN;
- (* Actually a button pressed ? *)
-
- PROCEDURE TextCoords(flag : BOOLEAN);
- (* Use text-coordinates ? *)
-
- PROCEDURE MouseInArea(x1, y1, x2, y2 : INTEGER)
- : BOOLEAN;
- (* Is mouse-pointer in area ? *)
-
- PROCEDURE SetMSpeed (s : INTEGER);
- (* Set mouse-speed *)
-
- PROCEDURE WaitMEvent;
- (* Wait until mouse moved or button clicked *)
-
- PROCEDURE ActMButton() : INTEGER;
- (* Which mouse-button is actually pressed ? *)
-
- PROCEDURE GetMRate (VAR xmove, ymove : INTEGER);
- (* Whats the mouse-moving rate since *)
- (* last event (in mickeys) ? *)
-
- PROCEDURE SetTextMAttr (MouseChar : CHAR;
- CharColor,
- BackgroundColor : INTEGER);
- (* Set mouse pointer attributes for textmode *)
-
- PROCEDURE SetGraphM (HotX, HotY : INTEGER;
- masks : tMMasks);
- (* Define graphics mouse pointer *)
-
- PROCEDURE SetMFence (x1, y1, x2, y2 : INTEGER);
- (* set limits of mouse area *)
-
- PROCEDURE MPointerOn;
- (* Switch mouse pointer on *)
-
- PROCEDURE MPointerOff;
- (* Switch mouse pointer off *)
-
- PROCEDURE MState (VAR ActX, ActY,
- PressedButtons : INTEGER);
- (* Position and pressed button(s) *)
-
- PROCEDURE SetMouse (x, y : INTEGER);
- (* Set mouse position *)
-
- PROCEDURE MButtonPressedPolling (button : INTEGER;
- VAR x,y,n : INTEGER);
- (* Where has the button been pressed *)
- (* and how often since last call ? *)
-
- PROCEDURE MButtonReleasedPolling (button : INTEGER;
- VAR x,y,n : INTEGER);
- (* Where has the button been released and *)
- (* how often since last call ? *)
-
- END Mouse.