Jump to content
Sign in to follow this  
HankHell

Hotkey same as Send won't work

Recommended Posts

HankHell

ran into this weird little thing, was wondering if someone could explain this to me

ReplaceKeys()

while 1
    sleep(50)
WEnd

Func ReplaceWith1()
    Send("g")
EndFunc

Func ReplaceKeys()

            HotKeySet("g", "ReplaceWith1")
EndFunc

for whatever reason, this does not work

Edited by HankHell

Share this post


Link to post
Share on other sites
SlackerAl

Are you sure that is what you want to happen? You are asking the script to wait until "g" is pressed and then get stuck in an endless loop of pressing "g".

I just ran this:

ReplaceKeys()

while 1
    sleep(50)
WEnd

Func ReplaceWith1()
      MsgBox(0,"test","here")
    Send("g")
EndFunc

Func ReplaceKeys()
    HotKeySet("g", "ReplaceWith1")
EndFunc

And it behaves as I would expect. What do you mean by "does not work"?


Problem solving step 1: Write a simple, self-contained, running, replicator of your problem.

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  

×