Sign in to follow this  
Followers 0
GarGar

Use a hotkey to send the same key as the hotkey without triggering itself?

2 posts in this topic

I'm trying to make a macro that will spam the 1 key as long as I'm holding it down (as in repeatedly press and release until I release the hotkey.) But what it does is do a loop of the hotkey triggering itself which does absolutely nothing. I'm wondering if there's a way to work around this somehow?

Another example is if I'm trying to make the hotkey "h" send the string "hello", if I do this it inputs 'ello' and triggers itself, which inputs 'ello' again and continues until I terminate it.

Here's the code I'm working with

Global $Paused
HotKeySet("{END}", "Terminate")
HotKeySet("1", "one")

While 1
WEnd

Func Terminate()
    Exit 0
EndFunc

Func one()
    While 1
        Send("1")
        sleep(2)
    WEnd
EndFunc

I'll try to be reasonable, I haven't worked with AutoIt much.

Share this post


Link to post
Share on other sites



Oops, first try led me to a 404 so I tried again, but it submitted 2 topics, can someone delete/lock please?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0