Jump to content

MouseMove Deceleration


Recommended Posts

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

Link to comment
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.
Link to comment
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.
Link to comment
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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...