Pausing the script on holding a button Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
KongKing
Posts: 76
Joined: 22 May 2022, 09:41

Pausing the script on holding a button

Post by KongKing » 15 Jul 2022, 20:38

Hi! How to make a script that stops when you hold down a key, e.g. b, and if it is released, it will turn on again?

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

Re: Pausing the script on holding a button  Topic is solved

Post by mikeyww » 15 Jul 2022, 20:57

Code: Select all

Gosub, b Up
Go:
Send x
b Up::SetTimer, Go, 50
b::SetTimer, Go, Off

Code: Select all

Loop {
 Send x
 Sleep, 50
}
b::Pause, On, 1
b Up::Pause, Off

KongKing
Posts: 76
Joined: 22 May 2022, 09:41

Re: Pausing the script on holding a button

Post by KongKing » 15 Jul 2022, 22:47

thanks :D :D

Post Reply

Return to “Ask for Help (v1)”