Sign in to follow this  
Followers 0
STAEDTLER

Mouse move relative

9 posts in this topic

#1 ·  Posted (edited)

AutoItSetOption("MouseCoordMode",0)

#include <Misc.au3>

$dll = DllOpen("user32.dll")

While 1
    If _IsPressed("01", $dll) Then
        
        MouseMove( 0,10, 20)

        
  EndIf
WEnd
DllClose($dll)

It doesn't Mouse Move using relative mode for some reason? Script purpose: When I hold left mouse click, it will move my mouse from the current location. Error:MouseCoordMode not working.

Edited by STAEDTLER

Share this post


Link to post
Share on other sites



I notice the help has "Sleep ( 250 )" in the while loop, have you tried putting that in?


Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic]

Share this post


Link to post
Share on other sites

I notice the help has "Sleep ( 250 )" in the while loop, have you tried putting that in?

I don't see how that can help. Thank you for trying though.

Share this post


Link to post
Share on other sites

Maybe you want??

Opt("GUICoordMode", 0) ;1=absolute, 0=relative, 2=cell

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Maybe you want??

Opt("GUICoordMode", 0) ;1=absolute, 0=relative, 2=cell

8)

No, basically I want my mouse cursor to more in a certain direction when i hold a key(in this case the left mouse button).

Share this post


Link to post
Share on other sites

No, basically I want my mouse cursor to more in a certain direction when i hold a key(in this case the left mouse button).

Use MouseGetPos() and then add/subtract to the values and pass them to MouseMove.


Broken link? PM me and I'll send you the file!

Share this post


Link to post
Share on other sites

AutoIt used to support relative motion... didn't it?

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

#include <Misc.au3>

$dll = DllOpen("user32.dll")

While 1
    If _IsPressed("01", $dll) Then
     $array= MouseGetPos() 
     
        
       MouseMove( $array[0],$array[1]+10, 2)

        
  EndIf
WEnd
DllClose($dll)

This worked but can I make it so that if a key is held down, this script wont run. LShift key?

Edited by STAEDTLER

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