Key hold does not work

Post AHK_H specific scripts & libraries and discuss the usage and development of HotKeyIt's fork/branch
I3onaQua
Posts: 2
Joined: 15 Nov 2022, 18:14

Key hold does not work

15 Nov 2022, 18:21

Hello. I have a problem and I can't do it on my own. The task is to hold the desired button for a certain time.

Code: Select all

 j::
Send {k down} ; Press key "1".
Sleep 100 ; Keep it pressed for 100 milliseconds.
Send {k up} ; Let go.
This method doesn't work. Only a single press occurs. The Sleep command pauses before an employee press. I tried a bunch of everything and even:

Code: Select all

j::
loop
{
send L
if A_Index = 30
break
}
return
Index = 30 is a few clicks (30) but it doesn't help either. Here, in general, the computer gave an error (blue screen). Is this functionality even possible? it's very easy to do it through keyboard macros but all I found are paid ones like Keyran or BotMek

[Mod edit: Placed the code box tags around the code.]
User avatar
boiler
Posts: 16978
Joined: 21 Dec 2014, 02:44

Re: Key hold does not work

15 Nov 2022, 19:06

@I3onaQua - I'm leaving this post here for now since it's possible you're really using AHK_H. Did you mean to post here? Do you know what AHK flavor you're using?

Return to “AutoHotkey_H”

Who is online

Users browsing this forum: No registered users and 91 guests