Returns the current cursor position in screen pixel coordinates.
Moves the cursor to the specified screen coordinates.
Target X position in pixels.
Target Y position in pixels.
Optionalsmooth: booleanWhen true, the cursor glides to the target over ~100 ms. Defaults to false.
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: MouseClickButtonWhich button to click. Defaults to "left".
Optionalclicks: numberNumber of consecutive clicks. Defaults to 1. Use 2 for double-click.
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: MouseClickButtonButton to press: "left", "right", "middle", "x1", "x2". Defaults to "left".
Injects a button-up (release) event without a preceding press.
Intended to pair with a prior Mouse.Down call.
Optionalbutton: MouseClickButtonButton to release: "left", "right", "middle", "x1", "x2". Defaults to "left".
Performs a mouse drag operation (left button) from one point to another. The cursor is moved to the start position, the button is pressed, the cursor glides to the end position, then the button is released.
Starting X position in pixels.
Starting Y position in pixels.
Ending X position in pixels.
Ending Y position in pixels.
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: MouseButtonOptionsOptional 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: MouseButtonOptionsOptional 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: MouseButtonOptionsOptional configuration. See MouseUpOptions for details.