home *** CD-ROM | disk | FTP | other *** search
-
-
- { Microsoft Mouse function access routines }
- { (C) 1986 John Vedral, Vedco Computer }
-
- { Full commercial version available for a small $5.00 donation from:
-
- Vedco Computer
- 128 Terbell Pky.
- River Vale, NJ 07675
-
- Includes all mouse functions and full documentation as well as programming
- examples. }
-
-
-
-
- function mouse_installed : boolean;
-
- { return true if the mouse driver and hardware are installed. Also
- resets mouse to default settings. }
-
- type registers = record
- ax, bx, cx, dx, bp, di, si, ds, es, flags : integer
- end; { record registers }
-
- var regs : registers;
-
- begin
- regs.ax := 0; { invoke mouse function 0 }
-
- intr($33, regs);
-
- if regs.ax = 0 then
- mouse_installed := false
- else
- mouse_installed := true;
- end; { function mouse_installed }
-
-
-
- function button_press(button : integer) : boolean;
-
- { returns true if button has been pressed. Button = 0 for left button and 1
- for right button }
-
- type registers = record
- ax, bx, cx, dx, bp, di, si, ds, es, flags : integer
- end;
-
- var regs : registers;
-
- begin
- regs.ax := 5; { invoke mouse function 5 }
- regs.bx := button;
-
- intr($33, regs);
-
- button_press := (regs.bx > 0);
- end; { function button_pressed }
-
-
-
- procedure show_cursor;
-
- { makes the cursor visible }
-
- type registers = record
- ax, bx, cx, dx, bp, di, si, ds, es, flags : integer
- end; { record registers }
-
- var regs : registers;
-
- begin
- regs.ax := 1; { invoke mouse function 1 }
-
- intr($33, regs);
- end; { procedure show_cursor }
-
-
-
- procedure hide_cursor;
-
- { makes cursor invisible }
-
- type registers = record
- ax, bx, cx, dx, bp, di, si, ds, es, flags : integer
- end; { record registers }
-
- var regs : registers;
-
- begin
- regs.ax := 2; { invoke mouse function 2 }
-
- intr($33, regs)
- end; { procedure hide_cursor }
-
-
-
- procedure get_cursor_position(var horizontal, vertical : integer);
-
- { get the position of the cursor on the screen }
-
- type registers = record
- ax, bx, cx, dx, bp, di, si, ds, es, flags : integer
- end; { record registers }
-
- var regs : registers;
-
- begin
- regs.ax := 3; { invoke mouse function 3 }
-
- intr($33, regs);
-
- horizontal := regs.cx;
- vertical := regs.dx;
- end; { procedure get_cursor_position }
-
-
-
- procedure set_cursor_position(horizontal, vertical : integer);
-
- { move the cursor to the specified position }
-
- type registers = record
- ax, bx, cx, dx, bp, di, si, ds, es, flags : integer
- end; { record registers }
-
- var regs : registers;
-
- begin
- regs.ax := 4; { invoke mouse function 4 }
- regs.cx := horizontal;
- regs.dx := vertical;
-
- intr($33, regs);
- end; { procedure set_cursor_position }
-
-
-
- procedure set_min_max_horiz(minimum, maximum : integer);
-
- { set the minimum and maximum horizontal position of the cursor }
-
- type registers = record
- ax, bx, cx, dx, bp, di, si, ds, es, flags : integer
- end; { record registers }
-
- var regs : registers;
-
- begin
- regs.ax := 7;
- regs.cx := minimum;
- regs.dx := maximum;
-
- intr($33, regs);
- end; { procedure set_min_max_horiz }
-
-
-
- procedure set_min_max_vert(minimum, maximum : integer);
-
- { set the minimum and maximum vertical position of the cursor }
-
- type registers = record
- ax, bx, cx, dx, bp, di, si, ds, es, flags : integer
- end; { record registers }
-
- var regs : registers;
-
- begin
- regs.ax := 8;
- regs.cx := minimum;
- regs.dx := maximum;
-
- intr($33, regs);
- end; { procedure set_min_max_vert }
-
-
-
- procedure set_graphics_cursor(hot_spot_x, hot_spot_y : integer;
- var cursor : cursor_array);
-
- { Pass a custom cursor to the mouse hardware. Cursor information contained
- in type cursor_array = array[0..31] of integer. See examples in manual.
- Concatenate the two arrays shown in the manual into one array. }
-
- type registers = record
- ax, bx, cx, dx, bp, di, si, ds, es, flags : integer
- end; { record registers }
-
- var regs : registers;
-
- begin
- regs.ax := 9;
- regs.bx := hot_spot_x;
- regs.cx := hot_spot_y;
- regs.dx := ofs(cursor[0]);
- regs.es := seg(cursor[0]);
-
- intr($33, regs);
- end; { procedure set_graphics_cursor }
-
-
-
- procedure read_counters(var horizontal, vertical : integer);
-
- { read the the horizontal and vertical mickey count since the last call to
- this procedure }
-
- type registers = record
- ax, bx, cx, dx, bp, di, si, ds, es, flags : integer
- end; { record registers }
-
- var regs : registers;
-
- begin
- regs.ax := 11;
-
- intr($33, regs);
-
- horizontal := regs.cx;
- vertical := regs.dx;
- end; { procedure read_counters }
-
-
-
- procedure user_subroutine(mask, subroutine_segment, subroutine_offset : integer);
-
- { allows a branch to the specified subroutine according to the conditions
- specified in the call mask. See the Microsoft mouse manual for details }
-
- type registers = record
- ax, bx, cx, dx, bp, di, si, ds, es, flags : integer
- end; { record registers }
-
- var regs : registers;
-
- begin
- regs.ax := 12;
- regs.cx := mask;
- regs.es := subroutine_segment;
- regs.dx := subroutine_offset;
-
- intr($33, regs);
- end; { procedure user_subroutine }