Jump to content

MouseMove


Recommended Posts

Hi,

When I use MouseMove the mouse position returns back to it's original position when it's done.

I'd like the mouse to stay at it's new position so that if I use the mouse manually it starts from it's new position.

I would be grateful if anyone could help me find out how to do that.

Link to comment
Share on other sites

Most of this is from the help file but "TblOne()" function and the "HotKeySet("{F7}", "TblOne")" is mine.

; Press Esc to terminate script, Pause/Break to "pause"

Global $Paused
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{ESC}", "Terminate")
HotKeySet("{F7}", "TblOne")
HotKeySet("+!d", "ShowMessage") ;Shift-Alt-d

;;;; Body of program would go here;;;;
While 1
    Sleep(100)
WEnd
;;;;;;;;

Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
        ToolTip('Script is "Paused"',0,0)
    WEnd
    ToolTip("")
EndFunc

Func Terminate()
    Exit 0
EndFunc

Func ShowMessage()
    MsgBox(4096,"","This is a message.")
EndFunc


Func TblOne()
    MouseMove(10, 10)
EndFunc
Link to comment
Share on other sites

Just to clarify, my code above does not work the way I want to.

Well it does everything that i expected it to do when i tested it, so what do you want it to do that it is not doing?
Link to comment
Share on other sites

Well it does everything that i expected it to do when i tested it, so what do you want it to do that it is not doing?

1. I start the script.

2. I move the mousepointer to the center of the screen by using the mouse manually.

3. I then use F7. (and expect the mouse to be moved).

4. I move the mouse manually.

When I do (4) I expect the mousepointer to start from it's new position (coordinates) not from center of screen (or its position I set in (2)).

It does not work when I do it. Instead it will start from the position in (2) as if the mouse was not moved at all or returned to the position set in (2).

Edited by Peter31
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...