Jump to content
Sign in to follow this  
Peter31

MouseMove

Recommended Posts

Peter31

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.

Share this post


Link to post
Share on other sites
Generator

It does stay in it's new spot.

Example:

MouseMove(0,0,10)

I think something wrong's with your code. Mind showing us?

Share this post


Link to post
Share on other sites
Peter31

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

Share this post


Link to post
Share on other sites
Peter31

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

Share this post


Link to post
Share on other sites
Paulie

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?

Share this post


Link to post
Share on other sites
poisonkiller

Do you want it to do this:

Func TblOne()
    $pos = MouseGetPos()
    MouseMove(10, 10)
    MouseMove($pos[0], $pos[1])
EndFunc

Share this post


Link to post
Share on other sites
Peter31

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

Share this post


Link to post
Share on other sites
Peter31

Looks like it could be a VMWare issue.

It works on my host but not in the guest system.

I need it to work in my guest system. Any ideas.

Share this post


Link to post
Share on other sites
Generator

Looks like it could be a VMWare issue.

It works on my host but not in the guest system.

I need it to work in my guest system. Any ideas.

Are you using VMWare?

Share this post


Link to post
Share on other sites
Peter31

Are you using VMWare?

Yes.

Share this post


Link to post
Share on other sites
Generator

Yes.

That might be an issue. Try absolute screen coord.

Share this post


Link to post
Share on other sites
Peter31

That might be an issue. Try absolute screen coord.

Thanks but how do I do that?

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  

×