Domino Posted September 25, 2022 Posted September 25, 2022 AutoIt V1.14 (20220122) Windows-10 with 2 monitors The displays are organized as on picture1. Display 1 (Main display) = 3440*1440 Landscape Display 2 (on main's right side) = 1440*2560 Portrait I use the following AutoIt code: $w = 200 $h = 200 $x00 = 4000 $y00 = 1000 Dim $aS[4] $aS[0]=10 $aS[1]=25 $aS[2]=50 $aS[3]=100 Dim $aX[4] $aX[0]=$x00 - 350 $aX[1]=$x00 + 350 $aX[2]=$x00 + 350 $aX[3]=$x00 - 350 Dim $aY[4] $aY[0]=$y00 - 400 $aY[1]=$y00 - 400 $aY[2]=$y00 + 400 $aY[3]=$y00 + 400 For $i = 0 to UBound($aS) -1 $SPEED_DRAG = 100 or $SPEED_DRAG = $aS[$i] $x0 = $aX[$i] $y0 = $aY[$i] MouseClickDrag($MOUSE_CLICK_LEFT, $x0, $y0, $x0+$w, $y0, $SPEED_DRAG) MouseClickDrag($MOUSE_CLICK_LEFT, $x0+$w, $y0, $x0+$w, $y0+$h, $SPEED_DRAG) MouseClickDrag($MOUSE_CLICK_LEFT, $x0+$w, $y0+$h, $x0, $y0+$h, $SPEED_DRAG) MouseClickDrag($MOUSE_CLICK_LEFT, $x0, $y0+$h, $x0, $y0, $SPEED_DRAG) Next This code is supposed to draw 4 squares. As expected on Display 1 4 sqares are drawn. However on Display 2 no sqares are drawn. Picture 2 shows the result when the speed is kept the same during the whole experiment ($SPEED_DRAG = 100). Each of the 4 drawings are different because of the position on the Display. Also, The MouseClickDrag does 2 sweeps here, one drawing, the second one not drawing, only moving. Although each sweep starts from a different place, the 2 sweeps end at the same place. Their ways are also different. The second sweep does not produce any trace, but its existence is also strange. Picture 3 shows what happens when the drawing speed is changed (from 10 to 100). Each of the 4 drawings are different because of the drawing speed. The comment about the 2 sweeps is also valid here. Replacing MouseClickDrag by MouseMove gives the same erratic behaviour. Is this problem avoidable?
Domino Posted September 25, 2022 Author Posted September 25, 2022 I swapped the extended display from right to left, but this has no impact on the behaviour. Then I made het test program more clear. I draw 10 horizontal lines and 10 vertical lines with the following script: Opt("MouseCoordMode", 1) ;1=absolute, 0=relative, 2=client $w = 1100 $h = 1200 $x0 = -1300 $y0 = 300 $SPEED_DRAG = 100 For $i = 0 to 10 MouseClickDrag($MOUSE_CLICK_LEFT, $x0, $y0, $x0+$w, $y0, $SPEED_DRAG) $y0 += $h / 10 Next ChangeColor() $y0 = 1300 For $i = 0 to 10 $x0 += $w / 10 MouseClickDrag($MOUSE_CLICK_LEFT, $x0, $y0, $x0, $y0+$h, $SPEED_DRAG) Next The result is still very strange. Each sweep starts with an overshoot and very slowly returns to the expected line. In addition the overshoot and the resulting lines have different shapes. This bothered me a lot until I found the cause of this behaviour, hence the solution to this problem. EUREKA. Both displays had their "Recommended" Scale and Layout (cfr. Windows Display settings). In detail the Main screen (Display 1) stayed at 100% where Display 2 (extended display) was set at the recommended scale of 125%. With these different scales, not too disrupting for normal work, the move and drag mouse commands were useless.
angelrobot13 Posted September 25, 2022 Posted September 25, 2022 So, you solved it? Quote This bothered me a lot until I found the cause of this behaviour, hence the solution to this problem. EUREKA. Both displays had their "Recommended" Scale and Layout (cfr. Windows Display settings). In detail the Main screen (Display 1) stayed at 100% where Display 2 (extended display) was set at the recommended scale of 125%. With these different scales, not too disrupting for normal work, the move and drag mouse commands were useless.
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