Jump to content
Sign in to follow this  
Floflo

put parameters on HotKeySet

Recommended Posts

Floflo

Hello

I've got a function that call another one with HotKeySet

Func Toto($titi)

$HK=HotKeySet("{Esc}","Ptilou")

msgbox....

msgbox...

[]

msgbox...

[]

...

EndFunc

Func Ptilou($y)

...

...

EndFunc

My first problem is that I want that the Function Toto waits for the user to press 'Esc' between [].

Then, I would like to put one parameter in the function Ptilou, but I don't know how I can put it using HotKeySet (cause I don't want to use a Global Variable).

Thanks

Bye

Share this post


Link to post
Share on other sites
SmOke_N

You can't use parameters with HotKeySet() directly, make another function it calls and send the parameter that way if you must, otherwise, what's wrong with global?


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites
Floflo

Finally i use global. I don't like to use global cause i learnt in all other languages that it increase the memory use (I don't know how i can explain it, but something like that).

My problem is to pause the first Function until the user call the second by "pressing" 'Esc'.

PS: i'm not sure of "pressing", just press the HotKey 'Esc' .

Thanks for the first answer, which was very quick.

++

Edited by Floflo

Share this post


Link to post
Share on other sites
Briegel

Do you mean something like this?

Func Toto($titi)
$HK=HotKeySet("{Esc}","Ptilou")
$go_on = 0

msgbox....
msgbox...
[]
SplashTextOn('Title','Press ESC ...',100,50)
While 1
    If $go_on = 1 Then ExitLoop
    Sleep(100)
WEnd
[]
...
EndFunc

Func Ptilou($y)
SplashOff()
$go_on = 1
MsgBox()
EndFunc

EDIT: SplashTextOn() instead of MsgBox().

Edited by Briegel

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  

×