Code: Select all
class COMMAND
{
__New(command, argsNum := 0, argsTypes := 0, functionCalled := 0)
{
if functionCalled {
this.command := command
} else {
this.command := functionCalled
}
if Not argsTypes {
this.argsNum := argsTypes.Length()
this.argsTypes := argsTypes
} else {
this.argsNum := argsNum
this.argsTypes := {}
Loop, %argsNum% {
this.argsTypes.Push("/w")
}
}
Hotstring(":X*B0:/" . command , Func("this.commandHandler"), "On")
}
commandHandler() {
MsgBox Hello World
}
}
Code: Select all
Hotstring(":X*B0:/" . command , Func("this.commandHandler"), "On")
Code: Select all
Hotstring(":X*B0:/" . command , someFunction(someArguments), "On")