Current code:
Code: Select all
$Space::
WinGetActiveTitle, Title
Loop
{
if not GetKeyState("Space", "P") and Title = "AppName"
break
Click
}
return
Code: Select all
$Space::
WinGetActiveTitle, Title
Loop
{
if not GetKeyState("Space", "P") and Title = "AppName"
break
Click
}
return
Code: Select all
#IfWinActive ahk_exe notepad.exe
Space::
While GetKeyState(A_ThisHotkey, "P") {
Click
Sleep, 15
}
Return
#IfWinActive
This is clean and works well!mikeyww wrote: ↑27 Sep 2021, 16:15Code: Select all
#IfWinActive ahk_exe notepad.exe Space:: While GetKeyState(A_ThisHotkey, "P") { Click Sleep, 15 } Return #IfWinActive