Denny577 Posted January 20, 2009 Share Posted January 20, 2009 (edited) I created one too It supports hotkeys, GUI events, and tray events. You can add parameters to be passed to the function. If you specify "Exit" as the function (which is an unavailable function name ) it calls Exit. You can then define OnAutoItExit() to clean up or save settings Leave the function parameter blank to remove the event. I just realised it's undocumented... It does quite speak for itself though Example: #include <OnEvent.au3> _HotKeySet("^{F1}", "_MyHotKeyFunc", "Hello, World!") _HotKeySet("^{F2}", "_MyHotKeyFunc", "Param1, Param2") While 1 Sleep(100) WEnd Func _MyHotKeyFunc($Param1, $Param2) MsgBox(0, $Param1, $Param2) Exit EndFunc Advantages: - Takes in a string containing the parameters delimited by commas, therefore not setting any limit to the amount of parameters (only limit is string length), and I prefer strings over arrays ^^ Few disadvantages/bugs: - No ByRef support (yet) - If a parameter contains a comma, the result will not be as expected (As demonstrated above. Using an array instead of a string for the parameters would solve this). OnEvent.au3 Comments are always welcome. Regards Edited January 20, 2009 by Denny577 Link to comment Share on other sites More sharing options...
BrettF Posted January 20, 2009 Share Posted January 20, 2009 What makes this different and or better from others and what does it add to AutoIt's native stuff? Cheers, Brett Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Denny577 Posted January 20, 2009 Author Share Posted January 20, 2009 I believe I forgot to mention that you can pass parameters to the function. It supports an (almost, there is a limit to string length ) unlimited amount of parameters for the function to be called. It does not support ByRef parameters (yet, I just thought of one way to do this ). I'll add some stuff to my post Regards Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now