Jump to content

Recommended Posts

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.

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
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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...