Jump to content
Sign in to follow this  
crislivinitup

GUI/Hotkey Function call with parameters

Recommended Posts

crislivinitup

Is there anyway I can call a function from a guictrlsetonevent or hotkeyset command that will also have parameters?

I tried this:

HotKeySet("^a","add("&2&","&4&")")
while 1
sleep(100)
WEnd

Func add($a,$B)
    msgbox(0,"",$a+$B)
EndFunc

This however doesn't work. Anyone have any ideas or knowledge on the subject?

Share this post


Link to post
Share on other sites
BrettF

The called function can not be given parameters. They will be ignored.

So that answers you first question. An alternitave would be _IsPressed ().

An Example:

#Include <Misc.au3>
While 1
    Select
        Case _IsPressed(12 + 41); Checks if Alt + A is pressed
            Add(2, 4) ;Runs func "add"
        Case Else
            Sleep(100)
    EndSelect
WEnd

Func Add($a, $B)
    MsgBox(0, "", $a + $B)
EndFunc

---------------------------------------------------------------------------------------

10 Days, 7 hours..... Jeez this is too hard.... :whistle:

Edited by bert

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.