How do add a single action while a single key is held down?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
AMG
Posts: 1
Joined: 21 May 2018, 01:35

How do add a single action while a single key is held down?

21 May 2018, 14:57

$1::
SetTimer, Start, 1000
Return

Start:
SendInput {w down}
SendInput {w up}
SendInput {w down}
Sleep, 18000
SendInput {w up}
Sleep, 13000
MouseClick, left, 2200, 1250
Sleep, 3000
Return

esc::exitapp

This script makes it so that "w" is double pressed in rapid succession and second "w" is held down for 18 seconds:
1 sec delayed start, w,w(hold 18 sec) > 13 sec delay > mouse action > 3 sec delay > loop

I want to insert an action during the 18 seconds while "w" is held down > I would like "a" to be pressed for 1 second on 0:05 of 0:18

Basically it will become something like this:

1 sec delayed start, w,w(hold) 0:00-0:18 (send a for 1 sec @ 0:05) > 13 sec delay > mouse action > 3 sec delay > loop

The "w" hold must not be interrupted.

Please and thank you.
AHKStudent
Posts: 1472
Joined: 05 May 2018, 12:23

Re: How do add a single action while a single key is held down?

21 May 2018, 16:21

would this not work?

Code: Select all

SendInput {w down}
Sleep, 5000
SendInput {a down}
Sleep, 1000
SendInput {a up}
Sleep, 12000
SendInput {w up}
other option is to used a timer

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: scriptor2016 and 326 guests