jessem Posted January 2, 2006 Share Posted January 2, 2006 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 ! Link to comment Share on other sites More sharing options...
herewasplato Posted January 2, 2006 Share Posted January 2, 2006 (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") EndFuncEdit: ...or did I not understand your request... Edited January 2, 2006 by herewasplato [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
jessem Posted January 2, 2006 Author Share Posted January 2, 2006 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") EndFuncEdit: ...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 ! Link to comment Share on other sites More sharing options...
herewasplato Posted January 2, 2006 Share Posted January 2, 2006 ...THANK YOU !You are welcome... and welcome to the forums. [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
seandisanti Posted January 3, 2006 Share Posted January 3, 2006 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 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now