Jump to content

AutoIt powered mouse events, _Mouse_UDF


AlmarM
 Share

Recommended Posts

Sorry to be a pain, but would you be able to wrap this up in a ZIP file. Thanks

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

Sorry to be a pain, but would you be able to wrap this up in a ZIP file. Thanks

No problem, check first post. :D

Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

Link to comment
Share on other sites

Hi Almar

Thanks for sharing.

In a mouse tablet, like in notebooks (win 7, at least), you can also make zoom, rotate, etc. Do you believe that you could include in your UDF the detections of kind of interactions? They are standard?

Thanks

Jose

Link to comment
Share on other sites

Hi Almar

Thanks for sharing.

In a mouse tablet, like in notebooks (win 7, at least), you can also make zoom, rotate, etc. Do you believe that you could include in your UDF the detections of kind of interactions? They are standard?

Thanks

Jose

I'm not familiar with those mouse tablets. My UDF is using the _IsPressed UDF from Misc.au3. If you know the keycode for those buttons you mentioned, I can include it. :P

Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

Link to comment
Share on other sites

Thanks. Hopefully people use 7-Zip or such-like to decompress the rar file. Now on to your UDF.

 

  • I notice that in certain areas of your UDF/Example you're using 'magic numbers', please refrain from using them and opt for constant variables instead e.g. -3 should be $GUI_EVENT_CLOSE as it's obvious to the end user what is happening.
  • Dim is deprecated in AutoIt (though still exists for backwards compatibility). For $___aiMousePos it should be Local, as it's Local to the scope and not used elsewhere. OR wrap in a function.
  • You might want to re-think about your Global variable names, as I dare say someone who uses your UDF will more than likely have a variable somewhere called $abOldStates or such-like. Perhaps a prefix of $g_ME_VarName would be a better choice. You decide which is unique to you.

All in all it didn't crash on 64-bit Windows 7, so well done!

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

Thanks. Hopefully people use 7-Zip or such-like to decompress the rar file. Now on to your UDF.

 

  • I notice that in certain areas of your UDF/Example you're using 'magic numbers', please refrain from using them and opt for constant variables instead e.g. -3 should be $GUI_EVENT_CLOSE as it's obvious to the end user what is happening.
  • Dim is deprecated in AutoIt (though still exists for backwards compatibility). For $___aiMousePos it should be Local, as it's Local to the scope and not used elsewhere. OR wrap in a function.
  • You might want to re-think about your Global variable names, as I dare say someone who uses your UDF will more than likely have a variable somewhere called $abOldStates or such-like. Perhaps a prefix of $g_ME_VarName would be a better choice. You decide which is unique to you.

All in all it didn't crash on 64-bit Windows 7, so well done!

Thanks for the feedback!

I have updated my UDF and example. The fun fact is, I already thought I should use some kind of prefix, so that's why $___aiMousePos does have it. No clue why I stopped and didn't replace all other variables though. :P

I replaced them all with $Q__ which seems pretty unique in my eyes. Should I also think of something for $MOUSE_X, $MOUSE_Y, etc?

I have also updated the UDF a little bit with another function.

Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

Link to comment
Share on other sites

OK. $g_ would have been suffice. Thanks.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

I was expecting a real event function but it's not.

You call repeatedly a function to check if a click has happened, but I see the UDF is well done and your objective was to make it user friendly.

Concerning the others UDF crashing, either there are some mistakes or it AutoIt has its limits (I would choose the first option).

Link to comment
Share on other sites

I was expecting a real event function but it's not.

You call repeatedly a function to check if a click has happened, but I see the UDF is well done and your objective was to make it user friendly.

Concerning the others UDF crashing, either there are some mistakes or it AutoIt has its limits (I would choose the first option).

I have updated my first post to say how this UDF works. Thanks for the heads-up. :D

I'm not sure why my compiled script crashed when using the other UDF which used DllCalls. If anyone else ever experienced it, and they can't figure out a solution, they might find this useful. :graduated:

Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

Link to comment
Share on other sites

I'm not familiar with those mouse tablets. My UDF is using the _IsPressed UDF from Misc.au3. If you know the keycode for those buttons you mentioned, I can include it. :P

Sorry Almar, mouse TOUCHPAD, not tablet, present  in all notebooks, like synaptics brand and others.

On these devices, besides pointing, we also have zoom, rotate, etc..

I have no idea if they are specific for each touchpad (I think not, as graphical programs run on any notebook), browsers are expanded (zoomed in-out), by these movements, etc.

So the idea would be to have events like $EVENT_MOUSE_ZOOM, $EVENT_MOUSE_ROTATE

   and properties like $MOUSE_ZOOM (-100 t0 100) and $MOUSE_ROTATE (-360 to 360)

Link to comment
Share on other sites

  • 3 months later...
  • 5 months later...
  • 1 year later...

getting error  [error: missing separator character before keyword.] in the UDF while executing the example.au3

I have not touched the code for a long time, I think my UDF is not compatible with newer version of AutoIt anymore. As soon as I get home, I will take a look at it. :)

EDIT: I have downloaded and started the example.au3 myself on the latest AutoIt version and I am having no issues. What AutoIt version are you using? Where are you getting the error?

Edited by AlmarM

Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

Link to comment
Share on other sites

  • 1 month later...
>"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "C:\Users\careca\Desktop\Example.au3" /UserParams    
+>13:55:39 Starting AutoIt3Wrapper v.15.920.938.0 SciTE v.3.6.0.0   Keyboard:00000816  OS:WIN_10/  CPU:X64 OS:X64    Environment(Language:0409)
+>         SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE   UserDir => C:\Users\careca\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper   SCITE_USERHOME => C:\Users\careca\AppData\Local\AutoIt v3\SciTE 
>Running AU3Check (3.3.14.2)  from:C:\Program Files (x86)\AutoIt3  input:C:\Users\careca\Desktop\Example.au3
"C:\Users\careca\Desktop\_Mouse_UDF.au3"(202,28) : error: missing separator character before keyword.
            If (__CheckMouseDown(0))Then
            ~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Users\careca\Desktop\_Mouse_UDF.au3"(207,26) : error: missing separator character before keyword.
            If (__CheckMouseUp(0))Then
            ~~~~~~~~~~~~~~~~~~~~~~^
"C:\Users\careca\Desktop\_Mouse_UDF.au3"(227,28) : error: missing separator character before keyword.
            If (__CheckMouseDown(1))Then
            ~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Users\careca\Desktop\_Mouse_UDF.au3"(232,26) : error: missing separator character before keyword.
            If (__CheckMouseUp(1))Then
            ~~~~~~~~~~~~~~~~~~~~~~^
"C:\Users\careca\Desktop\_Mouse_UDF.au3"(252,28) : error: missing separator character before keyword.
            If (__CheckMouseDown(2))Then
            ~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Users\careca\Desktop\_Mouse_UDF.au3"(257,26) : error: missing separator character before keyword.
            If (__CheckMouseUp(2))Then
            ~~~~~~~~~~~~~~~~~~~~~~^
"C:\Users\careca\Desktop\_Mouse_UDF.au3"(277,28) : error: missing separator character before keyword.
            If (__CheckMouseDown(3))Then
            ~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Users\careca\Desktop\_Mouse_UDF.au3"(282,26) : error: missing separator character before keyword.
            If (__CheckMouseUp(3))Then
            ~~~~~~~~~~~~~~~~~~~~~~^
"C:\Users\careca\Desktop\_Mouse_UDF.au3"(302,28) : error: missing separator character before keyword.
            If (__CheckMouseDown(4))Then
            ~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Users\careca\Desktop\_Mouse_UDF.au3"(307,26) : error: missing separator character before keyword.
            If (__CheckMouseUp(4))Then
            ~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\careca\Desktop\Example.au3 - 10 error(s), 0 warning(s)
!>13:55:39 AU3Check ended. Press F4 to jump to next error.rc:2
+>13:55:39 AutoIt3Wrapper Finished.
>Exit code: 2    Time: 0.5948

Same here.

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

On 9-3-2016 at 2:57 PM, careca said:
[snip]

Same here.

Aaah! There was a space missing. I have updated the zip file and should be working now. :)

Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...