From: mfeldman@seas.gwu.edu (Michael Feldman)
Subject: Re: WANTED: mouse routines for Ada Z, Meridian ADA
Date: 1 May 91 03:05:52 GMT [thread overview]
Message-ID: <3142@sparko.gwu.edu> (raw)
In-Reply-To: 672925823.24304@eyrie.img.uu.oz.au
-- Package MSMOUSE:
--
-- Developed by:
-- Philip K. Thomas, The George Washington University
-- 04/20/88
--
-- This must used with the microsoft mouse driver active.
-- It is used to communicate with the microsoft mouse. The various
-- procedures are specified below.
--
-- This package uses the Meridian package INTERRUPT
--
-- Specification:
--
with Interrupt; use Interrupt;
Package MSMOUSE is
function Are_You_There return Boolean;
-- If mouse is active, resets mouse and returns True
-- Else returns False
procedure Show_Cursor;
-- Turns Cursor On
procedure Hide_Cursor;
-- Turns Cursor Off
procedure Get_Position(x:out Integer; y:out Integer);
-- Returns x,y position of cursor
procedure Set_Cursor(x:in Integer; y:in Integer);
-- Positions Coursor at location x,y
procedure Left_Button_Press(x:out Integer; y:out Integer; c:out Integer);
-- Returns number of times LEFT button was pressed since last call
-- also x,y position of cursor at last press
procedure Right_Button_Press(x:out Integer; y:out Integer; c:out Integer);
-- Returns number of times RIGHT button was pressed since last call
-- also x,y position of cursor at last press
procedure Left_Button_Release(x:out Integer; y:out Integer; c:out Integer);
-- Returns number of times LEFT button was released since last call
-- also x,y position of cursor at last release
procedure Right_Button_Release(x:out Integer; y:out Integer; c:out Integer);
-- Returns number of times RIGHT button was released since last call
-- also x,y position of cursor at last release
procedure Set_X_Window(min:in Integer; max:in Integer);
-- Restricts cursor movement to between min and max in the horizontal direction
procedure Set_Y_Window(min:in Integer; max:in Integer);
-- Restricts cursor movement to between min and max in the vertical direction
end MSMOUSE;
Package body MSMOUSE is
ms_vec: constant Interrupt_Range := 51; -- Microsoft's interrupt vector
Reg_File: Registers; -- Registers used for communication
procedure ms_int is
begin
vector (
on => ms_vec,
register_block => reg_file
);
end ms_int;
function Are_You_There return Boolean is
begin
reg_file.Ax:=0;
ms_int;
return not (reg_file.Ax = 0);
end Are_You_There;
procedure Show_Cursor is
begin
reg_file.Ax:=1;
ms_int;
end Show_Cursor;
procedure Hide_Cursor is
begin
reg_file.Ax:=2;
ms_int;
end Hide_Cursor;
procedure Get_Position(x:out Integer; y:out Integer) is
begin
reg_file.Ax:=3;
ms_int;
x:= reg_file.Cx;
y:= reg_file.Dx;
end Get_Position;
procedure Set_Cursor(x:in Integer; y:in Integer) is
begin
reg_file.Ax:=4;
reg_file.Cx:=x;
reg_file.Dx:=y;
ms_int;
end Set_Cursor;
procedure Left_Button_Press(x:out Integer; y:out Integer; c:out Integer) is
begin
reg_file.Ax:=5;
reg_file.Bx:=0;
ms_int;
x:= reg_file.Cx;
y:= reg_file.Dx;
c:= reg_file.Bx;
end Left_Button_Press;
procedure Right_Button_Press(x:out Integer; y:out Integer; c:out Integer) is
begin
reg_file.Ax:=5;
reg_file.Bx:=1;
ms_int;
x:= reg_file.Cx;
y:= reg_file.Dx;
c:= reg_file.Bx;
end Right_Button_Press;
procedure Left_Button_Release(x:out Integer; y:out Integer; c:out Integer) is
begin
reg_file.Ax:=6;
reg_file.Bx:=0;
ms_int;
x:= reg_file.Cx;
y:= reg_file.Dx;
c:= reg_file.Bx;
end Left_Button_Release;
procedure Right_Button_Release(x:out Integer; y:out Integer; c:out Integer) is
begin
reg_file.Ax:=6;
reg_file.Bx:=1;
ms_int;
x:= reg_file.Cx;
y:= reg_file.Dx;
c:= reg_file.Bx;
end Right_Button_Release;
procedure Set_X_Window(min:in Integer; max:in Integer) is
begin
reg_file.Ax:=7;
reg_file.Cx:=min;
reg_file.Dx:=max;
ms_int;
end Set_X_Window;
procedure Set_Y_Window(min:in Integer; max:in Integer) is
begin
reg_file.Ax:=8;
reg_file.Cx:=min;
reg_file.Dx:=max;
ms_int;
end Set_Y_Window;
end MSMOUSE;
prev parent reply other threads:[~1991-05-01 3:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1991-04-29 11:50 WANTED: mouse routines for Ada Z, Meridian ADA Naasif Gierdien
1991-05-01 3:05 ` Michael Feldman [this message]
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox