Jump to content

Recommended Posts

Posted

I'm trying to create a hotkey that when pushed it will Call Function1, when the same button is pushed again, it will then call Function2.

I've tried (rough example)

$i = 1 to 2

Hotkey ("c","Function"&$i")

Func Function$i()

Also many variations of this. Any assistance would be helpfull or maybe I'm looking at this from a wrong angle.

Thanks folks !

Posted (edited)

HotKeySet("c", "function1")

While 1
    Sleep(100)
   ;main script
WEnd

Func function1()
    MsgBox(0, "", "function1")
    HotKeySet("c", "function2")
EndFunc

Func function2()
    MsgBox(0, "", "function2")
    HotKeySet("c", "function3")
EndFunc

Func function3()
    MsgBox(0, "", "function3")
EndFunc
Edit: ...or did I not understand your request...

Edited by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

Posted

HotKeySet("c", "function1")

While 1
    Sleep(100)
  ;main script
WEnd

Func function1()
    MsgBox(0, "", "function1")
    HotKeySet("c", "function2")
EndFunc

Func function2()
    MsgBox(0, "", "function2")
    HotKeySet("c", "function3")
EndFunc

Func function3()
    MsgBox(0, "", "function3")
EndFunc
Edit: ...or did I not understand your request...

Perfect .. Looks like I was trying to do it the hard way, this was is much more clear. ... THANK YOU !

Posted

Perfect .. Looks like I was trying to do it the hard way, this was is much more clear. ... THANK YOU !

another way to skin the cat....

$ack = 1
HotKeySet("c","test")
while 1
    Sleep(10)
WEnd
Func test()
    Call("myfunc" & $ack)
    $ack = $ack + 1
EndFunc
Func myfunc1()
    MsgBox(0,"Function 1","first")
EndFunc
Func myfunc2()
    MsgBox(0,"Function 2","second")
EndFunc
Func myfunc3()
    MsgBox(0,"Function 3","third")
EndFunc

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
×
×
  • Create New...