How do I make a script that has a loop of holding down a key for a specific amount of seconds?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Shade4Real
Posts: 16
Joined: 16 Jun 2018, 00:54

Re: How do I make a script that has a loop of holding down a key for a specific amount of seconds?

16 Jun 2018, 01:43

Answering for the sake of those who research the same question I'm about to answer.
Replace yourkey with the key you want.

Code: Select all

$yourkey::
Sendinput, {yourkey down} ; holds key down
Sleep, 1000 ; set this to any value, this is 1 second in miliseconds
Sendinput, {yourkey up} ; releases key
Return ; stop script

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 196 guests