MOUSE Command

Example   See Also

Performs the equivalent of clicking, double-clicking, or moving the mouse, or performs a drag operation.

Syntax

MOUSE [CLICK | DBLCLICK] [AT nRow1, nColumn1]
| DRAG TO nRow2, nColumn2, nRow3, nColumn3 ...]
[PIXELS]
[WINDOW cWindowName]
[LEFT | MIDDLE | RIGHT]
[SHIFT] [CONTROL] [ALT]

Arguments

CLICK | DBLCLICK

Specifies that the mouse is clicked or double-clicked. If you omit the AT clause, the mouse is clicked or double-clicked at the current mouse pointer position.

AT nRow1, nColumn1

Specifies where the mouse is clicked, double-clicked, or the position to which the mouse pointer is moved. If you omit CLICK or DBLCLICK, the mouse pointer is moved to the position specified with nRow1, nColumn1.

Unless you specify a WINDOW, the position specified by nRow1, nColumn1 is relative to the main Microsoft Visual FoxPro window, and the position is determined by the font of the main Visual FoxPro window. Most fonts can be displayed in a wide variety of sizes, and some are proportionally spaced. A row corresponds to the height of the current font; a column corresponds to the average width of a letter in the current font.

You cannot use the AT clause to choose a Visual FoxPro menu title. Use SYS(1500) – Activate a System Menu Item instead to choose a menu title.

DRAG TO nRow2, nColumn2, nRow3, nColumn3 ...]

Specifies that the mouse pointer is dragged to a position or a set of positions.

When the mouse pointer is dragged, a mouse button is pressed and held down until the mouse pointer reaches the destination position; then the mouse button is released. If you omit the LEFT, MIDDLE, and RIGHT clauses, the left (primary) mouse button is pressed and held down by default.

The DRAG clause accepts multiple sets of nRow, nColumn coordinates, allowing the mouse pointer to be dragged to several positions.

If CLICK or DBLCLICK is included, the mouse is clicked or double-clicked at its current position; then the mouse pointer is dragged to the specified position.

PIXELS

Specifies that the position you include in the AT and DRAG TO clause is in pixels.

If PIXELS is omitted, the position is determined by the font of the main Visual FoxPro window or the window specified with cWindowName. Most fonts can be displayed in a wide variety of sizes, and some are proportionally spaced. A row corresponds to the height of the current font; a column corresponds to the average width of a letter in the current font.

WINDOW cWindowName

Specifies the window to which the coordinates in the AT and DRAG TO clauses are relative. If you don't include WINDOW and the name of an active window, the coordinates in the AT and DRAG TO clauses are relative to the main Visual FoxPro window.

To specify a system window or a toolbar, enclose the entire system window or toolbar name in quotation marks.

LEFT | MIDDLE | RIGHT

Specifies which mouse button is pressed when the mouse is clicked, double-clicked, or dragged. If you omit the LEFT, MIDDLE, and RIGHT clauses, the MOUSE commands acts as if you had clicked the left (primary) mouse button.

[SHIFT] [CONTROL] [ALT]

Specifies a key that is pressed when the mouse is clicked, double-clicked, or dragged. In Visual FoxPro for Windows, SHIFT specifies the SHIFT key, CONTROL specifies the CTRL key, and ALT specifies the ALT key.

You can specify any combination of SHIFT, CONTROL, and ALT.

Remarks

MOUSE is typically used to automate interactive application testing or to create demonstration programs.