Method mouse.move(+ 3 overloads)
Overload
Moves the cursor (mouse pointer) to the position x y relative to window w.
public static POINT move(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: |
y (Coord)
Y coordinate relative to the client area of w. Default - center. |
nonClient (bool)
x y are relative to the window rectangle. |
Returns
POINT
Cursor position in screen coordinates. |
Exceptions
AuWndException
|
ArgumentOutOfRangeException
The position is not in screen. No exception if option Relaxed is |
AuException
Failed to move the cursor to that position. Some reasons:
|
InputDesktopException |
Remarks
Overload(next)
Moves the cursor (mouse pointer) to the position x y relative to UI object obj.
public static void move(MObject obj, Coord x = default, Coord y = default)
Parameters
obj (MObject)
Can be wnd, elm, uiimage, screen, RECT in screen, RECT in window, mouse.lastXY ( |
x (Coord)
X coordinate relative to obj. Default - center. Examples: |
y (Coord)
Y coordinate relative to obj. Default - center. |
Exceptions
ArgumentOutOfRangeException
The position is not in screen. No exception if option Relaxed is |
AuException
Failed to move the cursor to that position. Some reasons:
|
InputDesktopException |
Exception
Other exceptions. Depends on obj type. |
Remarks
Overload(next)
Moves the cursor (mouse pointer) to the specified position in screen.
public static POINT move(Coord x, Coord y)
Parameters
Returns
POINT
Normalized cursor position. |
Exceptions
ArgumentOutOfRangeException
The position is not in screen. No exception if option Relaxed is |
AuException
Failed to move the cursor to that position. Some reasons:
|
InputDesktopException |
Remarks
Overload(top)
Moves the cursor (mouse pointer) to the specified position in screen.
public static void move(POINT p)
Parameters
p (POINT)
Coordinates. Tip: To specify coordinates relative to the right, bottom, work area or a non-primary screen, use Coord.Normalize, like in the example. |
Exceptions
ArgumentOutOfRangeException
The position is not in screen. No exception if option Relaxed is |
AuException
Failed to move the cursor to that position. Some reasons:
|
InputDesktopException |
Remarks
Examples
Save-restore mouse position.
var p = mouse.xy;
//...
mouse.move(p);
Use coordinates in the first non-primary screen.
mouse.move(Coord.Normalize(10, ^10, screen: screen.index(1))); //10 from left, 10 from bottom