Jump to content

put parameters on HotKeySet


Recommended Posts

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

Link to comment
Share on other sites

  • Moderators

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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...