MOUSE_SUBS subroutine (AREV Specific)
At 23 JAN 1998 09:46:26PM David Anderson wrote:
I am trying capture mouse clicks in AREV 3.12. I have found the MOUSE_CONSTANTS record in SYSINCLUDE and the $MOUSE_SUBS record in SYSOBJ.
My question is - how do you make use of this subroutine and its constants? What are the inputs and outputs for it
David Anderson
At 26 JAN 1998 04:12AM Andrew P McAuley wrote:
Taken from Revmedia FKB (see www.sprezzatura.com )
The Mouse_Subs routine has been fundamentally rewritten (to conform very
closely to the published specifications for the Microsoft mouse driver -
based around interrupt 33 calls) since it was discussed in Volume 3 Issue 7.
It now only takes 4 parameters. As previously the first one is an action
code but again, as this is a C or assembler routine the other parameters
vary based upon the action code.
Code ³ Description ³ Param1 ³ Param2 ³ Param3
ÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄ
0 ³ Initialize mouse driver.³ Must be null.³ Must be null ³ Must be null
³ Code returns 0 if a ³ Returns the ³ ³³ mouse is not installed ³ number of ³ ³³ or -1 if a mouse is ³ buttons which³ ³³ installed and reset. ³ is always 2 ³ ³³ ³ or Microsoft ³ ³³ If the mouse has been ³ Mouse ³ ³³ lost (due to PCing to ³ ³ ³³ DOS or somesuch) it can ³ ³ ³³ be restored with a ³ ³ ³³ Ctrl-Break OR by calling³ ³ ³³ Mouse_Subs passing it a ³ ³ ³³ 0 followed by a 1. ³ ³ ³ÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
1 ³ Turns mouse back on ³ Must be null ³ Must be null ³ Must be null
³ after it has been turned³ ³ ³³ off with a code 2 ³ ³ ³ÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
2 ³ Turns mouse off ³ Must be null ³ Must be null ³ Must be null
³ temporarily ³ ³ ³ÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
3 ³ Returns current location³ Must be ³ Must be ³ Must be
³ and state of mouse ³ initialised. ³ initialised. ³ initialised.³ ³ Returns ³ Returns the ³ Returns the³ ³ 0 No key ³ X position of³ Y position of³ ³ being ³ the mouse ³ the mouse³ ³ pressed ³ ³³ ³ 1 Left key ³ ³³ ³ being ³ ³³ ³ pressed ³ ³³ ³ 2 Right key ³ ³³ ³ being ³ ³³ ³ pressed ³ ³³ ³ 3 Left and ³ ³³ ³ right keys ³ ³³ ³ being ³ ³³ ³ pressed ³ ³ÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
4 ³ Locates mouse at a given³ Must be null ³ X position ³ Y position
³ X, Y position on screen ³ ³ ³ÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
5 ³ Returns current location³ Must be ³ Must be ³ Must be
and 6³ and button press state ³ initialised. ³ initialised. ³ initialised.
³ of mouse ³ Returns ³ ³³ ³ 0 Key ³ ³³ ³ released ³ ³³ ³ 1 Left key ³ ³³ ³ being ³ ³³ ³ held down ³ ³³ ³ 2 Right key ³ ³³ ³ being ³ ³³ ³ held down ³ ³³ ³ 3 Left and ³ ³³ ³ right keys ³ ³³ ³ being ³ ³³ ³ held down ³ ³ÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
7 ³ Sets the X coordinates ³ Must be null ³ Leftmost X ³ Rightmost X
³ within which the mouse ³ ³ position or ³ position or³ can operate ³ ³ rightmost X ³ leftmost X³ ³ ³ position ³ positionÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
8 ³ Sets the Y coordinates ³ Must be null ³ Leftmost Y ³ Rightmost Y
³ within which the mouse ³ ³ position or ³ position or³ can operate ³ ³ rightmost Y ³ leftmost Y³ ³ ³ position ³ positionÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
10 ³ Permits the definition ³ Initialise to³ Set to 32512 ³ Set to the
³ of the mouse cursor ³ zero ³ if using the ³ ascii value³ character and the cursor³ ³ third ³ to use for³ colour. At the time of ³ ³ parameter to ³ the mouse³ going to press the ³ ³ specify the ³ cursor, E.G.³ actual values have not ³ ³ character to ³ 2 for a³ been fully understood as³ ³ use for the ³ smiley face,³ it only seems to be used³ ³ cursor. ³ 65 for the³ in PAINT when several ³ ³ ³ letter A etc.³ items are selected by ³ ³ Set to 30719 ³³ "boxing". ³ ³ to reset the ³ Set to 30464³ ³ ³ block cursor.³ to reset the³ ³ ³ ³ block cursor.ÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
11 ³ Returns a location ³ Must be null ³ Must be ³ Must be null
³ relative to the last ³ ³ initialised. ³³ time the mouse was ³ ³ Returns the ³³ queried. Whilst this ³ ³ position of ³³ information is not ³ ³ the mouse ³³ stunningly useful on its³ ³ relative to ³³ own it does provide a ³ ³ where it last³³ good way of finding out ³ ³ was as a ³³ whether the mouse is ³ ³ positive or ³³ moving. If the second ³ ³ negative ³³ parameter returns a 0 ³ ³ integer. ³³ then the mouse is still,³ ³ ³³ any other value means ³ ³ ³³ that the mouse is moving³ ³ ³ÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
15 ³ Sets the mickey to pixel³ Must be null ³ The ³ The
³ ratio, that is, how far ³ ³ horizontal ³ vertical³ the mouse must move ³ ³ sensitivity ³ sensitivity³ before the mouse cursor ³ ³ of the mouse.³ of the mouse.³ moves accordingly. The ³ ³ The lower the³ The lower the³ lower the value in ³ ³ number, the ³ number, the³ Param2 and Param3 the ³ ³ more the ³ more the³ more sensitive the mouse³ ³ mouse cursor ³ mouse cursor³ is. ³ ³ moves for a ³ moves for a³ ³ ³ given mouse ³ given mouse³ ³ ³ movement. ³ movement.³ ³ ³ Experiment ³ Experiment³ ³ ³ with values ³ with values³ ³ ³ between 1 and³ between 1 and³ ³ ³ 20. ³ 20.ÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
21 ³ Gets buffer size in ³ Returns ³ Must be null ³ Must be null
³ bytes required by mouse ³ buffer size. ³ ³ÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
26 ³ Sets mouse sensitivity. ³ X value. ³ Y value. ³ Threshold for
³ The lower the value used³ Defaults to ³ Defaults to ³ double speed.³ the less sensitive the ³ 50. ³ 50. ³ Defaults to³ mouse is. The range ³ ³ ³ 50.³ appears to be 1 to 100. ³ ³ ³ÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
27 ³ Queries mouse ³ X value. ³ Y value. ³ Threshold for
³ sensitivity. ³ ³ ³ double speed.ÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
36 ³ Queries the version ³ Must be ³ Must be ³ Must be
³ number and the type of ³ initialised ³ initialised ³ initialised³ the mouse ³ to null. ³ to null. ³ to null.³ ³ Returns the ³ Returns the ³³ ³ version ³ type of ³³ ³ number as ³ mouse ³³ ³ what appears ³ multiplied by³³ ³ to be a ³ 256. Thus to ³³ ³ decimal ³ get the mouse³³ ³ string that ³ type divide ³³ ³ needs to be ³ by 256 and ³³ ³ converted to ³ use the ³³ ³ a hex string.³ figures below³³ ³ My mouse ³ taken from ³³ ³ version is ³ the ³³ ³ 7.04, the ³ SYSINCLUDE ³³ ³ number ³ record ³³ ³ returned for ³ CONFIGURE. ³³ ³ this is 1796,³ RECORD.EQUS ³³ ³ which if ³ 1 Bus ³³ ³ printed ³ 2 Serial ³³ ³ "MXyMD2" ³ 3 InPort ³³ ³ gives 7.04 ³ 4 PS/2 ³³ ³ ³ 5 HP ³ÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
Some calls have been omitted from the table above, specifically those which
have little practical use for normal AREV programming. Note that several of
the calls documented above are not currently used by AREV and thus may not
be future proof. (It is considered that if AREV itself uses undocumented
routines they are far more likely to stay there!). For further information
about the missing calls see the Microsoft Mouse Programmer's Reference.
Codes 7 and 8 are used to construct a box on the screen within which the
mouse may move. Normally this would be set to the screen width and depth but
there might be times when mouse movement within an area is desirable.
The code 10 can be used to good effect within a loop in a program when you
wish to indicate to a user that the mouse is inactive and that input from it
will be ignored. The mouse cursor can be changed to another figure, or even
as in the following example changed within the loop to give the illusion of
a turning bar.
/* Following code for demonstration purposes only, change the delay loopto suit your own computer */For z=1 to 100CALL MOUSE_SUBS( 10, 0, 32512, 47 ) ; * "/"for x=1 to 1000 ; nextCALL MOUSE_SUBS( 10, 0, 32512, 196 ) ; * "-"for x=1 to 1000 ; nextCALL MOUSE_SUBS( 10, 0, 32512, 92 ) ; * "\"for x=1 to 1000 ; nextCALL MOUSE_SUBS( 10, 0, 32512, 124 ) ; * "|"for x=1 to 1000 ; nextnextCALL MOUSE_SUBS( 10, 0, 30719, 30464 )(Volume 4, Issue 5, Pages 4-7)