Stompa Posted March 24, 2007 Share Posted March 24, 2007 I'm trying to simulate some mouse movement using MouseMove(). However, I'm finding that when approaching the destination coord the mouse pointer slowly decelerates - but I want it to move at a constant speed.I'm unclear whether MouseMove() is coded entirely in AutoIt, or whether it's simply calling some underlying Windows API function. Either way, could it be that it's the mouse settings on my PC that are causing the deceleration?I've tried disabling acceleration by moving my Mouse Speed slide bar all the way to the left as suggested here:http://support.microsoft.com/kb/149228and also disabling 'Enhance pointer precision', and my feeling is it does make some improvement, but there's still some deceleration occuring.Any ideas?ThanksStompa Link to comment Share on other sites More sharing options...
martin Posted March 24, 2007 Share Posted March 24, 2007 I'm trying to simulate some mouse movement using MouseMove(). However, I'm finding that when approaching the destination coord the mouse pointer slowly decelerates - but I want it to move at a constant speed.I'm unclear whether MouseMove() is coded entirely in AutoIt, or whether it's simply calling some underlying Windows API function. Either way, could it be that it's the mouse settings on my PC that are causing the deceleration?I've tried disabling acceleration by moving my Mouse Speed slide bar all the way to the left as suggested here:http://support.microsoft.com/kb/149228and also disabling 'Enhance pointer precision', and my feeling is it does make some improvement, but there's still some deceleration occuring.Any ideas?ThanksStompaLet's see your code. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
herewasplato Posted March 24, 2007 Share Posted March 24, 2007 (edited) ...MouseMove()...I want it to move at a constant speed...try: http://www.autoitscript.com/forum/index.ph...st&p=249007 I've not tested it. Edit: Welcome to the forum. Edited March 24, 2007 by herewasplato [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
Stompa Posted March 24, 2007 Author Share Posted March 24, 2007 Let's see your code.The code is trivial, something as simple as:MouseMove(100,100)MouseMove(800,800,50)will show the problem.Stompa Link to comment Share on other sites More sharing options...
martin Posted March 24, 2007 Share Posted March 24, 2007 The code is trivial, something as simple as: MouseMove(100,100) MouseMove(800,800,50) will show the problem. Stompa Yes, I see what you mean. But if you set the speed to 0 the move is instant. Do you want to move at a constant speed so that the cursor is visible? In this case could you try having a for next loop moving the mouse along the path a bit at a time with the speed set to 0, like this MouseMove(100,100) for $n = 100 to 800 Step 5 MouseMove($n,$n,0) sleep(10) Next Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
Stompa Posted March 25, 2007 Author Share Posted March 25, 2007 Yes, I see what you mean. But if you set the speed to 0 the move is instant. Do you want to move at a constant speed so that the cursor is visible? In this case could you try having a for next loop moving the mouse along the path a bit at a time with the speed set to 0, like this MouseMove(100,100) for $n = 100 to 800 Step 5 MouseMove($n,$n,0) sleep(10) Next Thanks, that's pretty much what I ended up doing, though because I'm actually using arbitrary points I just use Pythagoras to calculate the number of steps required. Unfortunately, I also have to omit the sleep(), since even using sleep(1) slows things down a great deal. Stompa Link to comment Share on other sites More sharing options...
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