Search the Community
Showing results for tags 'event-handling'.
-
Introduction The recently introduced feature of passing function pointers as arguments makes it possible, with the help of this UDF to create abriatary events with arguments. Here is a very simple example of a single-execution event: #include "GlobalEvents.au3" _GlobalEvents_Create("@SEC = 30", Test1) While Sleep(30) WEnd Func Test1() MsgBox(0, "Test", "@SEC equals 30!") EndFuncThis event will be triggered once, when @SEC is 30 and then die. Features Create how many events you want.An event can be created on every possible single-line AutoIt expression.You can pass an array of arguments to the event handler.There are two types of events: Single-execution (those are triggered once, then die - though you can reset them) and Looping, where the event triggers every time it evaluates true.You can pause and restart the evaluation of all events.You can set the delay between evaluations (standard is 333ms).You can destroy events. (The global event pool has an initial size of 1024 to prevent ReDim-ing. Destroying old events further prevents ReDim-ing.)It doesn't matter if your script operates in OnEvent or Message mode. You can use everything as usual (yes, even OnEvents and Adlib). Examples 1. Single-Execution (+ with arguments) 2. Looping execution (+ custom delay) Download See attachments. Example.au3 Example_Continious.au3 Example_Minimal.au3 GlobalEvents.au3