Sign in to follow this  
Followers 0
boogieoompa

Mouse drag return

5 posts in this topic

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



Maybe check out _IsPressed in the Beta?

Share this post


Link to post
Share on other sites

I cant find _ispressed in the help file.

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  
Followers 0