The cursor's absolute physical virtual-screen x/y coordinates at the time of the call.
Moves the cursor to an absolute position in physical Windows virtual-screen coordinates.
Absolute target X coordinate.
Absolute target Y coordinate.
Optionalsmooth: boolean
When true, the cursor glides to the target over ~100 ms. Defaults to false.
Resolves after the cursor reaches the target.
Coordinates share a space with Screen.FindImage, Screen.GetPixelColor, WindowInfo.bounds, and overlay bounds. Preserve each value's documented reference point: for example, Screen.FindImage returns an image center while overlay Move expects a top-left. The primary monitor starts at (0, 0); monitors to its left or above use negative coordinates. No DPI scaling is applied. Coordinates outside the current virtual desktop are clamped to its nearest edge.
Injects a complete button press-and-release at the current cursor position.
Sends both the DOWN and UP events as a matched pair. To inject only the
DOWN or only the UP, use Mouse.Down and Mouse.Up instead.
Optionalbutton: MouseClickButton
Which button to click. Defaults to "left".
Optionalclicks: number
Positive integer count of consecutive clicks. Defaults to 1; use 2 for a double-click.
Resolves after every requested click and inter-click delay completes.
Injects a button-down (press) event without a matching release.
Use Mouse.Up with the same button to release it.
Useful for simulating held button states or custom drag sequences.
Optionalbutton: MouseClickButton
Button to press: "left", "right", "middle", "x1", "x2". Defaults to "left".
Resolves after the button-down event is injected.
Injects a button-up (release) event without a preceding press.
Intended to pair with a prior Mouse.Down call.
Optionalbutton: MouseClickButton
Button to release: "left", "right", "middle", "x1", "x2". Defaults to "left".
Resolves after the button-up event is injected.
Performs a left-button drag between two absolute physical virtual-screen positions. The cursor is moved to the start position, the button is pressed, the cursor glides to the end position, then the button is released.
Absolute starting X coordinate.
Absolute starting Y coordinate.
Absolute ending X coordinate.
Absolute ending Y coordinate.
Resolves after the drag finishes and the button is released.
Emits vertical mouse-wheel detents at the current cursor position.
Signed detent count. Positive values scroll up; negative values scroll down.
Resolves after the wheel event is injected.
Each integer unit emits one Windows WHEEL_DELTA step (120). The operating system and target application decide how many text lines or pixels that step scrolls, so the historical parameter name lines is not a literal row count.
Registers a callback that fires on every raw mouse event. The script enters an event loop and stays alive as long as this handler is registered.
Handler receiving a RawMouseEvent for each mouse event.
Registers a callback that fires when a mouse button is pressed down, optionally requiring modifier keys to be held at the same time.
Combo format: optional modifier tokens joined with +, with the button name last.
Either-side modifiers: Ctrl, Shift, Alt, Win.
Lateral modifiers: LCtrl, RCtrl, LShift, RShift, LAlt, RAlt, LWin, RWin.
Button names (case-insensitive): LButton, RButton, MButton, XButton1, XButton2. Long aliases LeftButton, RightButton, MiddleButton, Mouse4, Mouse5 are also accepted.
Blocking (default block: true): Both the button-down and its paired button-up are suppressed from reaching other applications. The modifier keys themselves are not suppressed. Use Keyboard.Press to send any needed cleanup. Set block: false to observe the click while passing it through.
Button combination string, e.g. "LButton", "Shift+LButton", "Ctrl+Alt+RButton".
Function invoked when the combo fires (on button-down).
Optionaloptions: MouseButtonOptions
Optional configuration. See MouseButtonOptions for details.
Registers a callback that fires when a mouse button is pressed down, identical in behavior to Mouse.OnButton.
Use this when you want to be explicit that you are reacting to the press phase and may also register an OnUp handler for the release phase.
Button names and modifiers: same as Mouse.OnButton.
Blocking: same as Mouse.OnButton, both down and its paired up are suppressed when block: true (default).
Button combination string, e.g. "LButton", "Shift+LButton".
Function invoked on button-down.
Optionaloptions: MouseButtonOptions
Optional configuration. See MouseButtonOptions for details.
Registers a callback that fires when a mouse button is released.
Button names and modifiers: same as Mouse.OnButton.
Blocking: defaults to false. Set block: true in options to also suppress the button-up event from reaching other applications.
Pairing with OnDown: When a button-down was blocked by OnButton or OnDown, the button-up is already suppressed automatically. Register OnUp on the same button to observe or act on the release without needing to set block: true on the OnUp handler.
Button combination string, e.g. "LButton", "Shift+LButton".
Function invoked on button-up.
Optionaloptions: MouseButtonOptions
Optional configuration. See MouseUpOptions for details.
Returns the cursor's absolute position in physical Windows virtual-screen coordinates.