square65 Posted August 7, 2017 Posted August 7, 2017 If I use MouseMove and set the speed to, say, 100, then it will move quickly and slow down during the traversal. The speed is inconsistent. It starts fast and slows down. I've tested this extensively. A. Is there a reason for this B. Why isn't this mentioned in the documentation? C. What's the fix? I need non-instant mouse movement, but having it have this "feature" ruins my scripts.
Moderators JLogan3o13 Posted August 7, 2017 Moderators Posted August 7, 2017 @square65 can you please provide a reproducer that shows the behavior you're referencing? I don't use MouseMove, as it is inherently unreliable, but with this short snippet I am seeing consistent movement: While 1 MouseMove(100, 200, 100) Sleep(500) MouseMove(1000, 280, 100) Sleep(500) MouseMove(300, 500, 100) Sleep(500) WEnd More importantly, what are you trying to automate that you must use MouseMove? In almost every situation, there is an easier way to accomplish what you're after. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
square65 Posted August 7, 2017 Author Posted August 7, 2017 (edited) MouseMove (0, 0, 0) MouseMove (1000, 1000, 100) Moves quickly at first and then slows down. Also when it finishes its diagonal motion, at the end it moves straight down a bit which is also odd. I'm creating a script that will have the cursor visit every point in a 2d grid. edit: it actually moves a little to the right and then down at the very end. Giving it weird wobbly behavior. Edited August 7, 2017 by square65
Danp2 Posted August 7, 2017 Posted August 7, 2017 Could this be a setting in your mouse driver? For instance, the Logitech mouse driver offers a pointer acceleration option. Latest Webdriver UDF Release Webdriver Wiki FAQs
square65 Posted August 8, 2017 Author Posted August 8, 2017 (edited) I disabled "enhance pointer precision" and it didn't change the behavior. Here is the behavior in action: Edited August 8, 2017 by square65
spudw2k Posted August 8, 2017 Posted August 8, 2017 The "slow-down" seems to be by design. Even at slower speeds, the mouse "eases" into place at the end. Now, why the drop at the end instead of a more direct path...not sure if that was a design decision or oversight. Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX Builder Misc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retrieve SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose Array Projects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalc Cool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF
mikell Posted August 8, 2017 Posted August 8, 2017 (edited) The only way I can think of to solve this is to use a workaround Here is one - quickly done, no error checking, etc _MyMouseMoveAtConstantSpeed(100, 100, 1000, 700, 200) Func _MyMouseMoveAtConstantSpeed($x0, $y0, $x1, $y1, $k) ; params : x start, ystart, x end, y end, speed (higher = slower) Local $dx = $x1-$x0, $dy = $y1-$y0, $a = ($dx=0) ? 0 : $dy/$dx MouseMove ($x0, $y0, 0) Sleep(200) For $i = 0 to $k If $dx = 0 Then $x = $x0 $y = $y0 + ($i*$dy)/$k Else $x = $x0 + ($i*$dx)/$k $y = $y0 + $a*($x-$x0) EndIf MouseMove ($x, $y, 1) Next EndFunc Edit Sorry, forgot to mention : same issue on XP SP3 Edited August 9, 2017 by mikell
BrewManNH Posted August 9, 2017 Posted August 9, 2017 This appears to be a Windows or a driver issue rather than a MouseMove bug. I see the mouse movement the same as the OP on Win10, but I've never seen it behave like that on any other OS I've used it on. I'm running on an HP laptop, using a synaptics touch pad driver. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator
spudw2k Posted August 10, 2017 Posted August 10, 2017 My test was on Win 7 and was consistent with the OPs experience. Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX Builder Misc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retrieve SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose Array Projects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalc Cool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF
square65 Posted August 12, 2017 Author Posted August 12, 2017 Win 7 here. mikell, I've been doing it the way you suggested (albeit not quite as clean as yours) Suspected it might be an OS issue
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