Sign in to follow this  
Followers 0
bu66le

hotkeyset function

6 posts in this topic

Is there a way to pass parameter(s) to the function call by hotkeyset? eg. how do I pass a parameter to TogglePause for hotkey defined as followed:

HotKeySet("{PAUSE}", TogglePause")

Share this post


Link to post
Share on other sites



either have a Hotkeyset call a func that calls a function with paramaters or try looking at _ispressed with an if then , but i remember a topic on this not to long ago, i think it was resolved as a no you cant

Share this post


Link to post
Share on other sites

Not sure if this is what you mean, but based on how I read what you said...

HotKeySet("a", "ParameterFunction")
 
 While 1
     Sleep ( 100 )
 WEnd

Func ParameterFunction()
    ActualFunction ("These words are magic!")
EndFunc

Func ActualFunction($MagicWords)
    MsgBox ( 0, "", $MagicWords)
EndFunc

Share this post


Link to post
Share on other sites

well using ur example he wanted it to have the hotkey set wtih the Actualfunction("These Words are Magic!") as the function so it directly calls the function with the paramaters but the way you showed i believe is the only way around it

Share this post


Link to post
Share on other sites

basically, I would like to pass a parameter to the same function from different hotkeysets. It looks something like this but this code will not work:

HotKeySet("^#1", "GoOnline('www.google.com')")
HotKeySet("^#2", "GoOnline('www.yahoo.com')")

Func GoOnline($site)
   ;do something
EndFunc

Maybe thatsgreat2345 is right, I can't.

Thanks.

Share this post


Link to post
Share on other sites

Maybe thatsgreat2345 is right, I can't.

I think this line is true. :D

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