Jump to content
Sign in to follow this  
boogieoompa

Mouse drag return

Recommended Posts

Does anybody know how to wait for the user to click and drag. Effectively I want to execute a command when the user does a click and drag within a program however I do not know how to monitor for the mouse down with a mouse move.

Any suggestions?

Share this post


Link to post
Share on other sites

Its in the new beta release on the autoit forum download page. Here is the code I used, its a little sloppy but it works fine for me (or so it seems...).

#include <Misc.au3>

$dll = DllOpen("user32.dll")

While 1
    $oldpos = MouseGetPos()
    Sleep(250)
    $newpos = MouseGetPos()

    If $newpos[1] > $oldpos[1] Then
        If _IsPressed("01", $dll) Then
            MsgBox(0,"_IsPressed", "You clicked and draged down!")
        EndIf
    
    ElseIf $newpos[1] < $oldpos[1] Then
        If _IsPressed("01", $dll) Then
            MsgBox(0,"_IsPressed", "You clicked and draged up!")
        EndIf
    EndIf

WEnd

DllClose($dll)

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  

×
×
  • Create New...