Jump to content

HotKey in one app only


Recommended Posts

I am still very new to auto it and I have come across a little problem. I basically want to set a letter (without ctrl, alt, shift) to a hotkey that will only activate in one app. If that app is not active then I want it to send the key normally right now however the program gets caught in a loop it sends the letter which in turns starts the function which inturn sends the letter... Any suggestions

HotKeySet("i", "FunInverse")
Func FunInverse()
    If WinActive("VMonitor")  Then
        mouseclick("Right")
        Send("It worked!")
    Else
        Send("i")       
    Endif

EndFunc
Link to comment
Share on other sites

Yep. Read the helpfile. It says:

HotKeySet("{Esc}", "captureEsc")
Func captureEsc()
   ; ... can do stuff here
    HotKeySet("{Esc}")
    Send("{Esc}")
    HotKeySet("{Esc}", "captureEsc")
EndFunc
Who else would I be?
Link to comment
Share on other sites

Like this

HotKeySet("i", "FunInverse")

While 1
    Sleep(100)
WEnd

Func FunInverse()
    If WinActive("VMonitor")  Then
        mouseclick("Right")
        Send("It worked!")
    Else
        HotKeySet("i")
        Send("i")
        HotKeySet("i", "FunInverse")
    Endif

EndFunc

Hope it helps

8)

NEWHeader1.png

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...