Sign in to follow this  
Followers 0
Stompa

MouseMove Deceleration

6 posts in this topic

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/149228

and also disabling 'Enhance pointer precision', and my feeling is it does make some improvement, but there's still some deceleration occuring.

Any ideas?

Thanks

Stompa

Share this post


Link to post
Share on other sites



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/149228

and also disabling 'Enhance pointer precision', and my feeling is it does make some improvement, but there's still some deceleration occuring.

Any ideas?

Thanks

Stompa

Let'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.

Share this post


Link to post
Share on other sites

#3 ·  Posted (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 by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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
Sign in to follow this  
Followers 0