Popular Post MrCreatoR Posted February 21, 2008 Popular Post Posted February 21, 2008 (edited) This UDF allows to set an events handler for Mouse device. The beginning... I searched for a way to disable the Mouse Primary click, and be able to call some function when the click event is received... Big thanks to amel27 for this one, i only organized the whole stuff to UDF style. Example: expandcollapse popup#include <GUIConstantsEx.au3> #include "MouseOnEvent.au3" HotKeySet("{ESC}", "_Quit") _Example_Intro() _Example_Limit_Window() Func _Example_Intro() MsgBox(64, "Attention!", "Let's set event function for mouse wheel *scrolling* up and down", 5) ;Set event function for mouse wheel *scrolling* up/down and primary button *down* action (call our function when the events recieved) _MouseSetOnEvent($MOUSE_WHEELSCROLLDOWN_EVENT, "_MouseWheel_Events") _MouseSetOnEvent($MOUSE_WHEELSCROLLUP_EVENT, "_MouseWheel_Events") _MouseSetOnEvent($MOUSE_PRIMARYDOWN_EVENT, "_MousePrimaryDown_Event") Sleep(3000) ;UnSet the events _MouseSetOnEvent($MOUSE_WHEELSCROLLDOWN_EVENT) _MouseSetOnEvent($MOUSE_WHEELSCROLLUP_EVENT) _MouseSetOnEvent($MOUSE_PRIMARYDOWN_EVENT) ToolTip("") MsgBox(64, "Attention!", "Now let's disable Secondary mouse button up action, and call our event function.", 5) _MouseSetOnEvent($MOUSE_SECONDARYUP_EVENT, "_MouseSecondaryUp_Event", 0, 1) Sleep(5000) _MouseSetOnEvent($MOUSE_SECONDARYUP_EVENT) ToolTip("") EndFunc Func _Example_Limit_Window() Local $hGUI = GUICreate("MouseOnEvent UDF Example - Restrict events on specific window") GUICtrlCreateLabel("Try to click on that specific GUI window", 40, 40, 300, 30) GUICtrlSetFont(-1, 12, 800) GUICtrlCreateLabel("Press <ESC> to exit", 10, 10) GUISetState() _MouseSetOnEvent($MOUSE_PRIMARYDOWN_EVENT, "_MousePrimaryDown_Event", $hGUI) ;A little(?) bugie when you mix different events :( ;_MouseSetOnEvent($MOUSE_SECONDARYUP_EVENT, "_MouseSecondaryUp_Event", $hGUI) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $GUI_EVENT_PRIMARYDOWN MsgBox(0, "", "Should not be shown ;)") EndSwitch WEnd _MouseSetOnEvent($MOUSE_PRIMARYDOWN_EVENT) ;_MouseSetOnEvent($MOUSE_SECONDARYUP_EVENT) EndFunc Func _MouseWheel_Events($iEvent) Switch $iEvent Case $MOUSE_WHEELSCROLLDOWN_EVENT ToolTip("Wheel Mouse Button (scrolling) DOWN Blocked") Case $MOUSE_WHEELSCROLLUP_EVENT ToolTip("Wheel Mouse Button (scrolling) UP Blocked") EndSwitch Return $MOE_BLOCKDEFPROC ;Block EndFunc Func _MousePrimaryDown_Event() ToolTip("Primary Mouse Button Down Blocked") Return $MOE_BLOCKDEFPROC ;Block EndFunc Func _MouseSecondaryUp_Event() ToolTip("Secondary Mouse Button Up Blocked") EndFunc Func _Quit() Exit EndFunc Available Events Constants: Spoiler $MOUSE_MOVE_EVENT - Mouse moving. $MOUSE_PRIMARYDOWN_EVENT - Primary mouse button down. $MOUSE_PRIMARYUP_EVENT - Primary mouse button up. $MOUSE_PRIMARYDBLCLK_EVENT - Primary mouse button double click. $MOUSE_SECONDARYDOWN_EVENT - Secondary mouse button down. $MOUSE_SECONDARYUP_EVENT - Secondary mouse button up. $MOUSE_SECONDARYDBLCLK_EVENT - Secondary mouse button double click. $MOUSE_WHEELDOWN_EVENT - Wheel mouse button pressed down. $MOUSE_WHEELUP_EVENT - Wheel mouse button up. $MOUSE_WHEELDBLCLK_EVENT - Wheel mouse button double click. $MOUSE_WHEELSCROLL_EVENT - Wheel mouse scroll. $MOUSE_WHEELSCROLLDOWN_EVENT - Wheel mouse scroll Down. $MOUSE_WHEELSCROLLUP_EVENT - Wheel mouse scroll Up. $MOUSE_XBUTTONDOWN_EVENT - Side mouse button down (usually navigating next/back buttons). $MOUSE_XBUTTONUP_EVENT - Side mouse button up. $MOUSE_XBUTTONDBLCLK_EVENT - Side mouse button double click. $MOUSE_XBUTTON2DOWN_EVENT - Side mouse button 2 down (usually navigating next/back buttons). $MOUSE_XBUTTON2UP_EVENT - Side mouse button 2 up. $MOUSE_XBUTTON2DBLCLK_EVENT - Side mouse button 2 double click. ------------------------------------------ CHANGELOG: Spoiler v2.4 [15.03.2020] * Fixed crash issue when runing under x64 script. Thanks to LarsJ (Gary Frost?). * Added _MouseSetOnEvent_SetDblClckSpeed function to set double click speed. v2.3 [04.11.2015] * Added user public constants $MOE_RUNDEFPROC and $MOE_BLOCKDEFPROC, to use in Event function to define current event blocking. * Fixed issue with crash on changing events array. * Fixed issue with high CPU caused by incorrect timer kill. * Docs updated. v2.2 [13.08.2015] * AutoIt 3.3.6.1 - 3.3.8.1 supported again. * Code improvements and cosmetic changes. v2.1 [12.08.2015] * Now if $iBlockDefProc is 0 (or when using _MouseSetOnEvent_RI), user function $sFuncName called by PostMessage to prevent issues with hook (or WM_* message) stoppage. * Cosmetic code changes. * Docs updated. v2.0 [08.08.2015] * Script breaking version! * Dropped AutoIt 3.3.6.1 - 3.3.8.1 support. * Added alternative _MouseSetOnEvent_RI function using Raw Input Data instead of mouse hook. !!! This function does not support $iBlockDefProc. * Added support for XBUTTON2 detection. Use $MOUSE_XBUTTON2DOWN_EVENT, $MOUSE_XBUTTON2UP_EVENT, and $MOUSE_XBUTTON2DBLCLK_EVENT constants to separate between XBUTTON and XBUTTON2. * Cosmetic changes in the UDF code. v1.9 [22.07.2012] * Script breaking version! * Dropped AutoIt 3.3.0.0 support. * Instead of $sParam1 and $sParam2, now $vParam used as last parameter. * Event function ($sFuncName) now called with $iEvent as first parameter, and $vParam as second (both optional). * Now $iBlockDefProc is set to -1 by default (event function can define whether to block event process or not, simply by returning 1 or 0). * Fixed not working $MOUSE_PRIMARYDBLCLK_EVENT and $MOUSE_SECONDARYDBLCLK_EVENT, now handled manually because windows does not always receive these events (depending on CS_DBLCLKS style). (not tested properly, so these events will have "experimental" label for now). * Fixed error related to "Subscript used with non-Array variable", caused when window with handle of $hTargetWnd parameter is not found (window closed). * Examples updated. v1.8 [02.06.2010] * Fixed an issue with wrong handling when $MOUSE_XBUTTONUP/DOWN_EVENT and few other events are set. * Fixed an issue when user attempts to set other function for the event that already have been set. Now the function and other parameters are replaced for the current event. * UDF file renamed (removed "Set" in the middle and "_UDF" at the end of the name). * Cosmetic changes in the UDF code. * Docs updated. v1.7 [14.10.2009] * Stability fixes. Thanks again to wraithdu. v1.6 [13.10.2009] * Fixed an issue with releasing the resources of mouse hook (Thanks to wraithdu). v1.5 [09.10.2009] + Added wheel button up/down *scrolling* event recognition. Thanks to JRowe (http://www.autoitscript.com/forum/index.php?showtopic=103362). * Fixed an issue with returning value from __MouseSetOnEvent_MainHandler - should call _WinAPI_CallNextHookEx before return (thanks to Yashied). * Constants starting with MOUSE_EXTRABUTTON* renamed to MOUSE_XBUTTON*, as it should be in the first place. * Few examples updated. v1.4 [30.09.2009] + Added UDF header to the function. + Now the original events-messages (such as $WM_MOUSEMOVE) can be used as well. + Added missing events (although i am not sure if they are still supported) $MOUSE_PRIMARYDBLCLK_EVENT - Primary mouse button double click. $MOUSE_SECONDARYDBLCLK_EVENT - Secondary mouse button double click. $MOUSE_WHEELDBLCLK_EVENT - Wheel mouse button double click. $MOUSE_EXTRABUTTONDBLCLK_EVENT - Side mouse button double click. * Changed global vars and internal functions names to be more unique. * Fixed variables declaration and misspelling. v1.3 [27.10.2008] * Added optional parameter $iBlockDefProc - Define whether the Mouse events handler will block the default processing or not (Default is 1, block). If this is -1, then user can Return from the event function to set processing operation (see the attached example «AutoDrag window.au3»). v1.2 [05.04.2008] * Added: [Optional] parameter $hTargetWnd, if set, the OnEvent function will be called only on $hTargetWnd window, otherwise will be standard Event processing. Note: Can be a little(?) buggy when you mix different events v1.1 [22.03.2008] * Fixed: Incorrect ReDim when remove event from the array, it was causing UDF to crash script with error. * Spell/Grammar corrections * Added: An example of _BlockMouseClicksInput(). Download: Attached: MouseOnEvent_2.4.zip Old version: MouseOnEvent.zip - v2.3 MouseOnEvent_2.1.zip MouseOnEvent_2.0.zip MouseOnEvent_UDF_1.9.zip MouseSetOnEvent_UDF_1.8.zip MouseSetOnEvent_UDF_1.7.zip MouseSetOnEvent_UDF_1.6.zip MouseSetOnEvent_UDF_1.5.zip MouseSetOnEvent_UDF_1.4.zip MouseSetOnEvent_UDF_1.3.zip Previous downloads: 146 + 200 + 804 MouseOnEvent.zip MouseOnEvent.zip Edited March 15, 2020 by MrCreatoR New version jaberwacky, IgImAx, madzero and 6 others 8 1 Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1 AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ================================================== AutoIt is simple, subtle, elegant. © AutoIt Team
MrCreatoR Posted March 21, 2008 Author Posted March 21, 2008 One mounth, 51 downloads (views?), and no comments? Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1 AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ================================================== AutoIt is simple, subtle, elegant. © AutoIt Team
Xenobiologist Posted March 21, 2008 Posted March 21, 2008 Hi, seems to work quite fine! But I do not use OnEvent mode. Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times
weaponx Posted March 21, 2008 Posted March 21, 2008 Maybe the problem is that the title says "_MoseSetOnEvent"
MrCreatoR Posted March 21, 2008 Author Posted March 21, 2008 seems to work quite fine!Thanks.But I do not use OnEvent mode.The UDF has nothing to do with OnEvent mode - you can use it with any mode Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1 AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ================================================== AutoIt is simple, subtle, elegant. © AutoIt Team
Xenobiologist Posted March 21, 2008 Posted March 21, 2008 Thanks. The UDF has nothing to do with OnEvent mode - you can use it with any mode did just one short run and assumed the rest. It is cool. This way, it is possible to add an option to BlockInput to just disable the mouse. I tried this but it gets an error. #include <MouseSetOnEvent_UDF.au3> _blockInput() ToolTip('MouseClicks is disabled') Sleep(5000) _blockInput(1) ToolTip('MouseClicks is enabled') Sleep(5000) Func _blockInput($opt = 0) If $opt = 0 Then _MouseSetOnEvent($MOUSE_PRIMARYDOWN_EVENT, "_do") _MouseSetOnEvent($MOUSE_SECONDARYDOWN_EVENT, "_do") Else _MouseSetOnEvent($MOUSE_PRIMARYDOWN_EVENT) _MouseSetOnEvent($MOUSE_SECONDARYDOWN_EVENT) EndIf EndFunc ;==>_blockInput Func _do() EndFunc Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times
monoceres Posted March 21, 2008 Posted March 21, 2008 This is really useful, will certainly add this to my autoit directory on my desktop Broken link? PM me and I'll send you the file!
MrCreatoR Posted March 21, 2008 Author Posted March 21, 2008 did just one short run and assumed the rest. It is cool. This way, it is possible to add an option to BlockInput to just disable the mouse. I tried this but it gets an error. Oops , the error is because i did a mistake when the array is Redimmed... just find in the UDF this line: ReDim $aTmp_Mouse_Events[$aTmp_Mouse_Events[0][0]+1][0] and replace last [0] by [4] And nice example btw, i will include it into the archive, but i changed it a little(?)... #include <MouseSetOnEvent_UDF.au3> _BlockMouseClicksInput(0) ToolTip('MouseClicks is disabled') Sleep(3000) _BlockMouseClicksInput(1) ToolTip('MouseClicks is enabled') Sleep(3000) Func _BlockMouseClicksInput($iOpt=0) If $iOpt = 0 Then _MouseSetOnEvent($MOUSE_PRIMARYUP_EVENT, "__Dummy") _MouseSetOnEvent($MOUSE_PRIMARYDOWN_EVENT, "__Dummy") _MouseSetOnEvent($MOUSE_SECONDARYUP_EVENT, "__Dummy") _MouseSetOnEvent($MOUSE_SECONDARYDOWN_EVENT, "__Dummy") Else _MouseSetOnEvent($MOUSE_PRIMARYUP_EVENT) _MouseSetOnEvent($MOUSE_PRIMARYDOWN_EVENT) _MouseSetOnEvent($MOUSE_SECONDARYUP_EVENT) _MouseSetOnEvent($MOUSE_SECONDARYDOWN_EVENT) EndIf EndFunc ;==>_BlockMouseClicksInput Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1 AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ================================================== AutoIt is simple, subtle, elegant. © AutoIt Team
MrCreatoR Posted March 21, 2008 Author Posted March 21, 2008 Updated first post:CHANGELOG:v1.1 [22.03.2008]* Fixed: Incorrect ReDim when remove event from the array, it was causing UDF to crash script with error.* Spell/Grammar corrections * Added: An example of _BlockMouseClicksInput(). Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1 AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ================================================== AutoIt is simple, subtle, elegant. © AutoIt Team
Xenobiologist Posted March 22, 2008 Posted March 22, 2008 Hi, thanks for credit. That is what I meant. (example) Blocking the mouse is really helpful sometimes! Great! Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times
weaponx Posted March 22, 2008 Posted March 22, 2008 Maybe the problem is that the title says "_MoseSetOnEvent"The title of the topic and and the first post have a misspelling.
Achilles Posted April 1, 2008 Posted April 1, 2008 This is useful... Thanks! My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
topg Posted April 2, 2008 Posted April 2, 2008 Hi, I tried to play around with the following script. The intention is to demonstrate right mouse click in a specific application, say UltraEdit. It is very simple, if you right mouse click (down/up) when UltraEdit is active, then a tooltip will be displayed. If you right mouse click in another Window, it will perform normal right mouse click. If middle mouse button is clicked, the application will exit. I have two questions 1. what is the best way to make this program stay in memory to track mouse clicks until it is terminated? sleep(2147483647) is a bad way I suppose, but for testing purpose, it is ok another way is while 1 wend 2. this is really annoying me After this program exits, left mouse click is not able to activate other Window Only after I press Alt+Tab to switch to other Window, left mouse click starts to work normally Any inputs will be appreciated #include <MouseSetOnEvent_UDF.au3> _MouseSetOnEvent($MOUSE_SECONDARYUP_EVENT, "RightMouseUp") _MouseSetOnEvent($MOUSE_SECONDARYDOWN_EVENT, "RightMouseDown") _MouseSetOnEvent($MOUSE_WHELLUP_EVENT , "MiddleMouseUp") sleep(2147483647) Func RightMouseUp() If WinActive("UltraEdit") Then ToolTip("Right Mouse up") Else MouseUp("Right") EndIf EndFunc Func RightMouseDown() If WinActive("UltraEdit") Then ToolTip("Right Mouse down") Else MouseDown("Right") EndIf EndFunc Func MiddleMouseUp() _MouseSetOnEvent($MOUSE_SECONDARYUP_EVENT);Enable mouse button back. _MouseSetOnEvent($MOUSE_SECONDARYDOWN_EVENT);Enable mouse button back. _MouseSetOnEvent($MOUSE_WHELLUP_EVENT);Enable mouse button back. exit EndFunc
MrCreatoR Posted April 5, 2008 Author Posted April 5, 2008 First post updated:v1.2 [05.04.2008]* Added: [Optional] parameter $hTargetWnd, if set, the OnEvent function will be called only on $hTargetWnd window, otherwise will be standard Event processing.Note: Can be a little(?) buggy when you mix different events Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1 AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ================================================== AutoIt is simple, subtle, elegant. © AutoIt Team
MrCreatoR Posted April 5, 2008 Author Posted April 5, 2008 what is the best way to make this program stay in memory to track mouse clicks until it is terminated? sleep(2147483647) is a bad way I supposeYou can just set a loop: While 1 Sleep(10) WEnd Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1 AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ================================================== AutoIt is simple, subtle, elegant. © AutoIt Team
NELyon Posted April 7, 2008 Posted April 7, 2008 (edited) I know it's an older topic, but this is one of the few UDF's posted lately that I actually needed to use in a project of mine. Awesome UDF EDIT: I may have found a possible bug (Unless this is intended behavior) Try this code in SciTe: #include <MouseSetOnEvent_UDF.au3> _MouseSetOnEvent(516, "BlowUp") Sleep(5000) _MouseSetOnEvent(516) Func BlowUp() MsgBox(0, "Kaboom", "You all die") EndFunc Now press the right mouse button. You see the MsgBox. Now when you exit the MsgBox, the context menu appears as if you pressed the button twice. Is this intended? Edited April 7, 2008 by KentonBomb
MerkurAlex Posted April 8, 2008 Posted April 8, 2008 Great udf! [quote name='PsaltyDS' post='635433' date='Jan 27 2009, 07:04 AM']Larry is a mass murderer?! It's always the quiet, clean cut, bald guys... [/quote]
jennico Posted May 5, 2008 Posted May 5, 2008 damn, i really want to use your udf !!! but am i the only one who has problems ? i have got the "MouseSetOnEvent_UDF.au3", i tried it with v 3.2.8.1 and 3.2.10.0 and the latest beta, but i do not have the following functions: - DllCallbackRegister - DllCallbackGetPtr - DllCallbackFree and so on. so please where can i find these ? i've been searching the forum for hours, but there seems to be a problem with lots of functions with similar names. thx j. Spoiler I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.Don't forget this IP: 213.251.145.96
NELyon Posted May 5, 2008 Posted May 5, 2008 damn, i really want to use your udf !!!but am i the only one who has problems ? i have got the "MouseSetOnEvent_UDF.au3", i tried it with v 3.2.8.1 and 3.2.10.0 and the latest beta, but i do not have the following functions:- DllCallbackRegister- DllCallbackGetPtr- DllCallbackFreeand so on. so please where can i find these ? i've been searching the forum for hours, but there seems to be a problem with lots of functions with similar names.thxj.It requires Beta.
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