Denver Posted August 14, 2020 Posted August 14, 2020 Hello, I was wondering if anyone has a stand point on the fact that we get an array with MouseGetPos(), then we need to deconstruct it for MouseClick("primary", MouseGetPos()[0], MouseGetPos()[1])? Sure, UDFs like that might live: ;~ _MouseClickA("button" [, pos = default [, clicks = 1 [, speed = 10]]] ) Func _MouseClickA($button, $pos, $clicks = 1, $speed = 10) If $pos = default Then MouseClick($button) ElseIf Ubound($pos, 1) < 2 Then ;More than 2 should not be a problem, assuming [0]=x and [1]=y SetError(-1) ElseIf Ubound($pos, 0) > 1 Then SetError(-2) Else MouseClick($button, $pos[0], $pos[1], $clicks, $speed) EndIf EndFunc But I walked across four (namely: MouseClick(), MouseClickDrag(), MouseMove(), PixelGetColor()), and more may require such treatement (WinMove(), GUISetCoord(), GUICtrlSetPos(), GUICtrlCreateXyz(), GUICreate(), ControlMove(), ControlClick()). If that ever existed, would you have used it?
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