Moves the mouse cursor.
MouseMove X, Y , Speed, Relative
Type: Integer
The X and Y coordinates to move the mouse to. Coordinates are relative to the active window's client area unless CoordMode was used to change that.
Type: Integer
If omitted, the default speed (as set by SetDefaultMouseSpeed or 2 otherwise) will be used. Otherwise, specify the speed to move the mouse in the range 0 (fastest) to 100 (slowest). A speed of 0 will move the mouse instantly.
Speed is ignored for the modes SendInput and SendPlay; they move the mouse instantaneously (though SetMouseDelay has a mode that applies to SendPlay). To visually move the mouse more slowly -- such as a script that performs a demonstration for an audience -- use SendEvent "{Click 100 200}"
or SendMode "Event"
(optionally in conjuction with BlockInput).
Type: String
If blank or omitted, the X and Y coordinates will be used for absolute positioning. Otherwise, specify the following letter:
R: The X and Y coordinates will be treated as offsets from the current mouse position. In other words, the cursor will be moved from its current position by X pixels to the right (left if negative) and Y pixels down (up if negative).
This function uses the sending method set by SendMode.
The SendPlay mode is able to successfully generate mouse events in a broader variety of games than the other modes. In addition, some applications and games may have trouble tracking the mouse if it moves too quickly. The Speed parameter or SetDefaultMouseSpeed can be used to reduce the speed (in SendEvent mode only).
The BlockInput function can be used to prevent any physical mouse activity by the user from disrupting the simulated mouse events produced by the mouse functions. However, this is generally not needed for the modes SendInput and SendPlay because they automatically postpone the user's physical mouse activity until afterward.
There is an automatic delay after every movement of the mouse (except for SendInput mode). Use SetMouseDelay to change the length of the delay.
The following is an alternate way to move the mouse cursor that may work better in certain multi-monitor configurations:
DllCall("SetCursorPos", "int", 100, "int", 400) ; The first number is the X-coordinate and the second is the Y (relative to the screen).
On a related note, the mouse cursor can be temporarily hidden via the hide-cursor example.
CoordMode, SendMode, SetDefaultMouseSpeed, SetMouseDelay, Click, MouseClick, MouseClickDrag, MouseGetPos, BlockInput