' EXPLICAÇÃO DE CADA
FUNÇÃO E SUBROTINA PRESENTE NO PROGRAMA MOUSERT.BAS
'
' FUNCTION
CheckClick (button%, x1%, y1%, x2%, y2%)
' Retorna um valor “true”
ou “false”, dependendo do status do mouse
' was equivalent to
button% when the mouse coordinates were within the
' area defined by
(x1%, y1%) as upper left and (x2%, y2%) as lower right.
' If button% is set to -1, the button status
is ignored and CheckClick
' returns 1 (true) if
the mouse cursor is within the defined limits.
'
' SUB FindVectors
' Assigns the movement of the mouse to
variables, relative to the last
' time FindVectors was called.
' VectorX =
horizontal movement
' VectorY =
vertical movement
'
' FUNCTION
GetLastPressX (button%) and
' FUNCTION
GetLastPressY (button%)
' Return the last x and y coordinates where
the specified mouse button
' was pressed.
' If button% = 0, indicates left mouse
button
' If button% = 1, indicates right mouse
button
' If button% = 2, indicates middle mouse
button
'
' FUNCTION
GetLastReleaseX (button%) and
' FUNCTION
GetLastReleaseY (button%)
' Return the last x and y coordinates where
the specified mouse button
' was released.
' If button% = 0, indicates left mouse
button
' If button% = 1, indicates right mouse
button
' If button% = 2, indicates middle mouse
button
'
' FUNCTION
GetMouseButton
' Returns the current status of the mouse
button indicator
' Interpretation: * = Currently pressed
' Middle Right
Left
' 1 *
' 2 *
' 3 * *
' 4
*
' 5
* *
' 6
* *
' 7
* * *
'
' FUNCTION
GetMouseX
' FUNCTION
GetMouseY
' Return the current x and y coordinates of
the mouse
'
' SUB HideMouse
' SUB ShowMouse
' Manipulates the visibility of the default
mouse cursor (arrow)
'
' SUB InitMouse
' Initialises
the mouse for use with the other functions and subroutines.
' Error messages will result if other mouse
routines are called before this
' subroutine is
called (once at the beginning of the program is required).
'
' SUB SetLimitX (xMin%, xMax%)
' SUB SetLimitY (yMin%, yMax%)
' Sets the range of the values returned by
the GetMouseX and GetMouseY
' functions. Ideally, this is equivalent to the screen
resolution that
' is being used.
'
'
'
'
**************************************************************************
'
' ADVANCED EXPLANATION OF THE (ABSOLUTE)
PARAMETERS AND RETURN VALUES
'
' Use these notes for building your own
mouse routines
'
'When using
the following function:
'
' CALL Absolute(ax%, bx%,
cx%, dx%, SADD(mouse$))
'mouse$ = Hardware communications resource string (defined in
SUB InitMouse)
'ax% = the function flag
'
' 1 = Show mouse cursor
'
'
' 2 = Hide mouse cursor
'
'
' 3 = Return mouse coordinate and
button values
' Return values:
' bx%
= Button status
' Interpretation: * = Currently pressed
' Middle Right
Left
' 1 *
' 2 *
' 3 * *
' 4
*
' 5
* *
' 6
* *
' 7
* * *
' cx%
= Mouse x position
' dx%
= Mouse y position
' (Notice that the pattern for the buttons is
binary. The
' left button is bit
1, right button is bit 2, and middle
' button is bit 3, etc.)
'
'
'
' 5 = Returns the position of the last
mouse button depression
' Parameters:
' bx%
= Button number
' 0 = Left button
' 1 = Right button
' 2 = Middle button
' Return values:
' cx%
= X coordinate
' dx%
= Y coordinate
'
'
' 6 = Returns the position of the last
mouse button release
' Parameters:
' bx%
= Button number
' 0 = Left button
' 1 = Right button
' 2 = Middle button
' Return values:
' cx%
= X coordinate
' dx%
= Y coordinate
'
'
' 7 = Define mouse horizontal (x) range
' Parameters:
' cx%
= Minimum x value
' dx%
= Maximum x value
'
'
' 8 = Define mouse vertical (y) range)
' Parameters:
' cx%
= Minimum y value
' dx%
= Maximum y value
'
'
' 11 =
Returns the distance the mouse has moved since last check
' Return values:
' cx%
= X vector
' dx% = Y vector