mouse hold

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
Gylletanken
Posts: 28
Joined: 30 Nov 2024, 13:38

mouse hold

Post by Gylletanken » 02 Dec 2024, 11:28

How do i make a script that holds left mouse button for 2 sec?

User avatar
mikeyww
Posts: 29723
Joined: 09 Sep 2014, 18:38

Re: mouse hold

Post by mikeyww » 02 Dec 2024, 13:01

Code: Select all

#Requires AutoHotkey 2
F3:: {
 Click 'D'
 Sleep 2000
 Click 'U'
 SoundBeep 1500
}

Gylletanken
Posts: 28
Joined: 30 Nov 2024, 13:38

Re: mouse hold

Post by Gylletanken » 02 Dec 2024, 14:26

mikeyww wrote:
02 Dec 2024, 13:01

Code: Select all

#Requires AutoHotkey 2
F3:: {
 Click 'D'
 Sleep 2000
 Click 'U'
 SoundBeep 1500
}
Can you explain what it does?

User avatar
mikeyww
Posts: 29723
Joined: 09 Sep 2014, 18:38

Re: mouse hold

Post by mikeyww » 02 Dec 2024, 14:33

Hello,

The AHK documentation actually describes every statement in detail. The script, upon pressing F3, clicks down, waits 2 seconds, releases the button, and beeps. Another way of explaining:
holds left mouse button for 2 sec
Explained: Introduction and simple examples

Post Reply

Return to “Ask for Help (v2)”