Sign in to follow this  
Followers 0
Sunblood

Quick Hotkey Question

2 posts in this topic

If you set a hotkey (for example, HotKeySet("^{HOME}")) and then later in the script have a Send("") function that sends the hotkey, will the hotkey register in AutoIt?

I.E.

HotKeySet("^{HOME"},"OMG")
Sleep(5000)
Send("^{HOME}")

Func OMG()
   MsgBox(0,"","Roffles.")
EndFunc

I would try it out, but I'm not home.


Share this post


Link to post
Share on other sites



Yes, you'll throw the script into an infinite loop. You'll need to do something like this (Fixed your typo, too...):

HotKeySet("^{HOME}","OMG")
Sleep(5000)
HotkeySet("^{HOME}")   ; Remove the hotkey...
Send("^{HOME}")
HotKeySet("^{HOME}","OMG")   ; Readd the hotkey

Func OMG()
  MsgBox(0,"","Roffles.")
EndFunc

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