GetLastButtonPress Stores the position where Button was last pressed in x and y and returns the number of times this button has been pressed since the last call to this function with Button as parameter. For Button you can use the LButton, RButton and MButton constants for resp. the left, right and middle button. With certain mouse drivers, checking the middle button when using a two-button mouse to gives and clears the stats of the right button.
Listing: mmouseex/mouse5.pp
GetLastButtonRelease stores the position where Button was last released in x and y and returns the number of times this button has been released since the last call to this function with Button as parameter. For button you can use the LButton, RButton and MButton constants for resp. the left, right and middle button. With certain mouse drivers, checking the middle button when using a two-button mouse to gives and clears the stats of the right button.
For an example, see GetLastButtonPress (519).
GetMouseState Returns information on the current mouse position and which buttons are currently pressed. x and y return the mouse cursor coordinates in pixels. Buttons is a bitmask. Check the example program to see how you can get the necessary information from it.
Listing: mmouseex/mouse3.pp
HideMouse makes the mouse cursor invisible. Multiple calls to HideMouse will require just as many calls to ShowMouse to make the mouse cursor visible again.
For an example, see ShowMouse (532).
InitMouse Initializes the mouse driver sets the variable MouseFound depending on whether or not a mouse is found. This is Automatically called at the start of your program. You should never have to call it, unless you want to reset everything to its default values.
Listing: mmouseex/mouse1.pp
LPressed returns True if the left mouse button is pressed. This is simply a wrapper for the GetMouseState procedure.
For an example, see GetMouseState (521).
MPressed returns True if the middle mouse button is pressed. This is simply a wrapper for the GetMouseState procedure.
For an example, see GetMouseState (521).
RPressed returns True if the right mouse button is pressed. This is simply a wrapper for the GetMouseState procedure.
For an example, see GetMouseState (521).
SetMouseAscii sets the Ascii value of the character that depicts the mouse cursor in text mode. The difference between this one and SetMouseShape (528), is that the foreground and background colors stay the same and that the Ascii code you enter is the character that you will get on screen; there’s no XOR’ing.
Listing: mmouseex/mouse8.pp
SetMouseHideWindow defines a rectangle on screen with top-left corner at (xmin,ymin) and botto-right corner at (xmax,ymax),which causes the mouse cursor to be turned off when it is moved into it. When the mouse is moved into the specified region, it is turned off until you call ShowMouse again. However, once you’ve called ShowMouse (532), you’ll have to call SetMouseHideWindow again to redefine the hide window... This may be annoying, but it’s the way it’s implemented in the mouse driver. While xmin, ymin, xmax and ymax are Longint parameters, only the lower 16 bits are used.
Warning: it seems Win98 SE doesn’t (properly) support this function, maybe this already the case with earlier versions too!
Listing: mmouseex/mouse9.pp
SetMosusePos sets the position of the mouse cursor on the screen. x is the horizontal position in pixels, y the vertical position in pixels. The upper-left hand corner of the screen is the origin. While x and y are longints, only the lower 16 bits are used.
Listing: mmouseex/mouse4.pp
SetMouseShape defines how the mouse cursor looks in textmode The character and its attributes that are on the mouse cursor’s position on screen are XOR’ed with resp. ForeColor, BackColor and Ascii. Set them all to 0 for a ”transparent” cursor.
Listing: mmouseex/mouse7.pp
SetMouseSpeed sets the mouse speed in mickeys per 8 pixels. A mickey is the smallest measurement unit handled by a mouse. With this procedure you can set how many mickeys the mouse should move to move the cursor 8 pixels horizontally of vertically. The default values are 8 for horizontal and 16 for vertical movement. While this procedure accepts longint parameters, only the low 16 bits are actually used.
Listing: mmouseex/mouse10.pp
SetMousWindow defines a rectangle on screen with top-left corner at (xmin,ymin) and bottom-right corner at (xmax,ymax), out of which the mouse cursor can’t move. This procedure is simply a wrapper for the SetMouseXRange (531) and SetMouseYRange (531) procedures. While xmin, ymin, xmax and ymax are Longint parameters, only the lower 16 bits are used.
For an example, see SetMouseXRange (531).
SetMouseXRange sets the minimum (Min) and maximum (Max) horizontal coordinates in between which the mouse cursor can move. While Min and Max are Longint parameters, only the lower 16 bits are used.
Listing: mmouseex/mouse6.pp
SetMouseYRange sets the minimum (Min) and maximum (Max) vertical coordinates in between which the mouse cursor can move. While Min and Max are Longint parameters, only the lower 16 bits are used.
For an example, see SetMouseXRange (531).
ShowMouse makes the mouse cursor visible. At the start of your progam, the mouse cursor is invisible.
Listing: mmouseex/mouse2.pp