ExtendedPressMouse Method


AnyWin class.


Presses the mouse with one or more key modifiers.


This functionality is supported only if you are using the Open Agent.


ExtendedPressMouse (keyModifiers, iButton, x, y)
Variable Description
keyModifiers Defines which additional keys should be pressed while pressing the mouse. MODIFIERKEYSTATE.
iButton Optional: The mouse button to press: Windows: 1 for left (default), 2 for right, and 3 for center INTEGER.
x Optional: The horizontal coordinate (relative to the window) at which to press the mouse. If you specify x, you must also specify y. The default is 0 for a window, or the button center for a pushbutton. INTEGER.
y Optional: The vertical coordinate (relative to the window) at which to press the mouse. The default is 0 for a window, or the button center, for a pushbutton. INTEGER.


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

ExtendedPressMouse moves the mouse to the object and presses the specified mouse button (if it is not already pressed). The mouse is moved to the x and y coordinates before pressing. 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 coordinates, the press occurs in the upper left corner (0, 0) of the client area of the window.

ExtendedPressMouse does not actually generate mouse events when called. Instead, the events are queued until all keyboard and mouse events have been released. Events are not released until the call to ExtendedReleaseMouse.

You can call the AgentClass method FlushEvents if you want to do anything between pressing and releasing the mouse. Explicitly flushing events with FlushEvents is necessary if you want the mouse presses to happen now.