Jump to content

mouse move


Recommended Posts

mousemove works, but it moves the mouse in a fashion that's accelerate in the beginning, and then decelerate when it closes up on the destination.

I need the moues to move in a uniform speed, is that possible?

Link to comment
Share on other sites

well it's an old game that locks the mouse cursor to the center of the screen when you do something

and then when you move the mouse it translates to panning the camera.

that's why I need to to just move it 5 to the left and I can't seem to use coordianted mousemove.

Link to comment
Share on other sites

well it's an old game that locks the mouse cursor to the center of the screen when you do something

and then when you move the mouse it translates to panning the camera.

that's why I need to to just move it 5 to the left and I can't seem to use coordianted mousemove.

I haven't figured out what you mean by "coordianted mousemove" yet. Run this demo and reply with what you need that's different:

; Move mouse 5 pixels each time an arrow is hit:
#Include <Misc.au3>

Global $LEFT = "25", $UP = "26", $RIGHT = "27", $DOWN = "28"
Global $MouseSpeed = 50 ; 0=instant, 1=fastest, 100=slowest
HotKeySet("{END}", "_Quit")

While 1
    $avMousePos = MouseGetPos()
    If _IsPressed($LEFT) Then $avMousePos[0] -= 5
    If _IsPressed($UP) Then $avMousePos[1] -= 5
    If _IsPressed($RIGHT) Then $avMousePos[0] += 5
    If _IsPressed($DOWN) Then $avMousePos[1] += 5
    MouseMove($avMousePos[0], $avMousePos[1], $MouseSpeed)
    Sleep(20)
WEnd

Func _Quit()
    Exit
EndFunc   ;==>_Quit

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

I haven't figured out what you mean by "coordianted mousemove" yet. Run this demo and reply with what you need that's different:

i think that by "coordinated mousemove" he means that he wants the mouse to move at the same speed all the time, not in the more natural way it is by default!!

Link to comment
Share on other sites

no, the mouse cursor actually doesn't appear to move for 5 pixels.

it's the camera panned by the movement of the mouse, which, equal to 5 pixels but looking out from the the panned camera of 5 pixels it's quite a difference.

and the un uniform speed mess things up.

Link to comment
Share on other sites

no, the mouse cursor actually doesn't appear to move for 5 pixels.

it's the camera panned by the movement of the mouse, which, equal to 5 pixels but looking out from the the panned camera of 5 pixels it's quite a difference.

and the un uniform speed mess things up.

You may be stuck with coding your own loop of 1 pixel moves. By tweaking a delay Sleep() in the loop you might achieve the speed and smoothness you want. A movement of 1 pixel, by definition, can't have a "speed" so it will be at the speed of your loop:

For $m = 0 To 1
    For $n = 1 To 100
        $avMousePos = MouseGetPos()
        If $m Then
            $avMousePos[0] += 1
        Else
            $avMousePos[0] -= 1
        EndIf
        MouseMove($avMousePos[0], $avMousePos[1])
        Sleep(20) ; Tweak this sleep for speed
    Next
Next
Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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...