From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.7 required=5.0 tests=BAYES_00,INVALID_DATE, MSGID_SHORT,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!uunet!seas.gwu.edu!mfeldman From: mfeldman@seas.gwu.edu (Michael Feldman) Newsgroups: comp.lang.ada Subject: Re: WANTED: mouse routines for Ada Z, Meridian ADA Keywords: mouse Message-ID: <3142@sparko.gwu.edu> Date: 1 May 91 03:05:52 GMT References: <672925823.24304@eyrie.img.uu.oz.au> Reply-To: mfeldman@seas.gwu.edu () Organization: The George Washington University, Washington D.C. List-Id: -- 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;