Hello everyone. I love ahk, but by myself i`m cannot realise my idea. Need your help.
technical task:
If i press key "1" and when hold it, i wanna the nummber 1 to be infinitly spammed. Until i realese it. (OK i can do it like that)
example:
BUT...Code: Select all
/* ************************************************************************************** цифра 1 vk31 11111111111111 ************************************************************************************** */ ~vk31:: loop { GetKeyState, ScrollLockState, ScrollLock, T if (ScrollLockState = "U") { break } else { Send {vk31} Sleep, 20 ; Sleep for 20 msec GetKeyState, state, vk31, P if state = U ; The key has been released, so break out of the loop. break } } return
)
My task for you is much harder.
I wanna to press key combo`s, spam a lot of keys and until it press it all of them are will be sended. Autorepeat pressed key`s.
I can spam separately but not simultaneously.
I can fix it - if i created a lot of ahk script`s and run them one by one.
I hope it will be easy like that:
This example is incorrect
Code: Select all
Key := % A_ThisHotKey %
while GetKeyState(Key, "P")
{
Send %key% or %key-combos%
}
return
better but dont support combos:
Code: Select all
#Persistent ; may not actually be necessary...
Loop, 255
Hotkey, % "~" Format("vk{:x}",A_Index), pressed, On
return
pressed:
spamkey := GetKeyName(SubStr(A_ThisHotkey,2))
; Tooltip % "You pressed " GetKeyName(SubStr(A_ThisHotkey,2))
Tooltip % spamkey
while GetKeyState(spamkey, "P")
{
Send %spamkey%
}
return