holding a key to execute a command and release to exit Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
jerryrig
Posts: 40
Joined: 01 May 2021, 23:31

holding a key to execute a command and release to exit

06 Jun 2021, 09:33

i want to send some text if i hold a key and stop sending that text as i release it > :crazy:
User avatar
mikeyww
Posts: 27366
Joined: 09 Sep 2014, 18:38

Re: holding a key to execute a command and release to exit

06 Jun 2021, 09:44

Code: Select all

F3::
While GetKeyState(A_ThisHotkey, "P") {
 Send e
 Sleep, 20
}
Return
jerryrig
Posts: 40
Joined: 01 May 2021, 23:31

Re: holding a key to execute a command and release to exit

06 Jun 2021, 09:56

tnx mikee ..
actually ..
by pressing a button . i want ro send tr {enter}
by releasing a button
i like to hit escape without pressing esxape
🐈
i hv tried alot to modify
User avatar
mikeyww
Posts: 27366
Joined: 09 Sep 2014, 18:38

Re: holding a key to execute a command and release to exit  Topic is solved

06 Jun 2021, 10:00

Code: Select all

F3::
While GetKeyState(A_ThisHotkey, "P") {
 Send tr{Enter}
 Sleep, 20
}
Return
What the script does: "send some text if i hold a key and stop sending that text as i release it"
jerryrig
Posts: 40
Joined: 01 May 2021, 23:31

Re: holding a key to execute a command and release to exit

06 Jun 2021, 10:25

i added a break after sleep ... and it worked fine

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], moltenchees, niCode and 175 guests