Show / Hide Table of Contents

Method mouse.rightClick(+ 2 overloads)


Overload

Right button click at position x y relative to window w.

public static void rightClick(wnd w, Coord x = default, Coord y = default, bool nonClient = false)
Parameters
w  (wnd)

Window or control.

x  (Coord)

X coordinate relative to the client area of w. Default - center. Examples: 10, ^10 (reverse), .5f (fraction).

y  (Coord)

Y coordinate relative to the client area of w. Default - center.

nonClient  (bool)

The specified position is relative to the window rectangle, not to its client area.

Exceptions
AuWndException
  • The specified position is not in the window (read more in Remarks).
  • Invalid window.
  • The window is hidden. No exception if just cloaked, for example in another desktop; then on click will activate, which usually uncloaks. No exception if w is a control.
  • Other window-related failures.
ArgumentOutOfRangeException

The position is not in screen. No exception if option Relaxed is true (then moves to a screen edge).

AuException

Failed to move the cursor to that position. Some reasons:

  • The active window belongs to a process of higher UAC integrity level.
  • Another thread blocks or modifies mouse input (API BlockInput, mouse hooks, frequent API SendInput etc).
  • Some application called API ClipCursor. No exception if option Relaxed is true (then final cursor position is undefined).
InputDesktopException

Remarks

To move the mouse cursor, calls mouse.move. If after moving the cursor it is not in the window (or a window of its thread), activates the window (or its top-level parent window). Throws exception if then x y is still not in the window. Skips all this when just releasing button or if option Relaxed is true. If w is a control, x y can be somewhere else in its top-level parent window.

Uses opt.mouse: OMouse.MoveSpeed, OMouse.MoveSleepFinally (between moving and clicking), OMouse.ClickSpeed, OMouse.ClickSleepFinally, OMouse.Relaxed.


Overload(next)

Right button click at position x y.

public static void rightClick(Coord x, Coord y)
Parameters
x  (Coord)

X coordinate in the screen. Examples: 10, ^10 (reverse), .5f (fraction).

y  (Coord)

Y coordinate in the screen.

Exceptions
ArgumentOutOfRangeException

The position is not in screen. No exception if option Relaxed is true (then moves to a screen edge).

AuException

Failed to move the cursor to that position. Some reasons:

  • The active window belongs to a process of higher UAC integrity level.
  • Another thread blocks or modifies mouse input (API BlockInput, mouse hooks, frequent API SendInput etc).
  • Some application called API ClipCursor. No exception if option Relaxed is true (then final cursor position is undefined).
InputDesktopException

Remarks

Uses opt.mouse: OMouse.ClickSpeed, OMouse.ClickSleepFinally and those used by mouse.move.


Overload(top)

Right button click.

public static void rightClick(bool useLastXY = false)
Parameters
useLastXY  (bool)

Use mouse.lastXY, not current cursor position. More info: mouse.clickEx.

Exceptions
Exception

If lastXYtrue and need to move the cursor - exceptions of mouse.move.

InputDesktopException

Remarks

Uses opt.mouse: OMouse.ClickSpeed, OMouse.ClickSleepFinally and maybe those used by mouse.move.