ReleaseMouse Method

Class

AnyWin class.

Action

Releases a mouse button in the window.

Syntax

window.ReleaseMouse ([iButton, iXpos, iYpos, bRawEvent])
Variable Description
iButton Optional: The mouse button to press: Windows: 1 for left (default), 2 for right, and 3 for center. INTEGER.
iXpos Optional: The horizontal coordinate (relative to the current window) at which to release the mouse. You must also specify iYpos if you specify iXpos. The default is 0. INTEGER.
iYpos Optional: The vertical coordinate (relative to the current window) at which to release the mouse. The default is 0. INTEGER.
bRawEvent Optional: 32-bit Windows only. Used to specify playback method. The Open Agent ignores this value regardless of what is specified in the script. BOOLEAN.

Notes

ReleaseMouse moves the mouse to the window and releases the specified mouse button (if it is not already released).

ReleaseMouse is a low-level method that most scripts do not have to call. In general, when interacting with an application, you use the Click method to click the mouse, or a method designed to perform the action desired, such as Pick to pick a menu item.

The mouse is moved to the coordinates specified by iXpos and iYpos before performing the release. These coordinates are relative to the client area of the window (that is, the window’s internal area, excluding its caption, menu bar, and border). If you do not specify the coordinates of the release point, the release occurs in the upper left corner (0, 0) of the client area of the window.

To specify to ignore coordinates outside of the window, set the OPT_VERIFY_COORD option, using the SetOption method or the Verify that Coordinates Passed to a Method Are Inside the Window option on the Verification panel of the Agent Options dialog.

Example

MainWin.PressMouse (1, 100, 100)
MainWin.MoveMouse (100, 101)
MainWin.MoveMouse (100, 102)
MainWin.ReleaseMouse (1, 100, 103)