Skip to main content

Autohotkey - Mouse move

· One min read

Alpine landscape in Gaea

Simple script to drag the mouse to the left

Why would you need a script to drag the mouse with theleft button click slowly to the left?

I use this Autohotkey script to rotate a model in Gaea and screen capture it at the same time. So I start recording, fire the script below, place the mouse (script delays one second before starting), then the script clicks the left mosue button and slowly drags it to the left on the same y-axis - so slowly rotating the Gaea model.

A result is available here

Code - AutoHotkey 2.0

Autohotkey script to slowly drag the mouse on the y axis to the left
#Requires AutoHotkey v2.0
MouseGetPos &originalX, &originalY

; Wait one second
Sleep 1000

; Press left mouse button
Click "Down"

; Move the mouse cursor upwards gradually
currentX := originalX
Loop
{
currentX := currentX - 1
MouseMove currentX, originalY, 0
Sleep 30
if (originalX - currentX >= 1500)
Break
}

; Release left mouse button
Click "Up Left"

return