bu66le Posted June 8, 2006 Share Posted June 8, 2006 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") Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted June 8, 2006 Share Posted June 8, 2006 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 Link to comment Share on other sites More sharing options...
exodius Posted June 8, 2006 Share Posted June 8, 2006 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 Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted June 8, 2006 Share Posted June 8, 2006 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 Link to comment Share on other sites More sharing options...
bu66le Posted June 8, 2006 Author Share Posted June 8, 2006 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. Link to comment Share on other sites More sharing options...
exodius Posted June 8, 2006 Share Posted June 8, 2006 Maybe thatsgreat2345 is right, I can't.I think this line is true. 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