Sign in to follow this  
Followers 0
Werty

Detect mouse button release ?

11 posts in this topic

How do you detect if a mouse button has been released ?

The mouse functions in the help file got nothing, and the UDF helpfile has no example of how to use the _WinAPI_Mouse_Event function.

I need to detect if the right button is released (not if it is pressed, only that it is released)

Thanks.

Share this post


Link to post
Share on other sites



you can use _IsPressed() to see if it's down. if you loop it until it's not down, you're good


1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

No where, and anywhere.

I need it when zooming with the right button in Google Earth, then I want my script to do something when i release the right button, so the cursor isnt placed any particular place, it can be anywhere.

It's just the release itself I need.

Share this post


Link to post
Share on other sites

you can use _IsPressed() to see if it's down. if you loop it until it's not down, you're good

Wouldnt that just say that the button is unpressed, not released ?

I tried the ispressed like this...

If _IsPressed("02", $dll) Then
        MsgBox(1,"hello","hello")
        EndIf

But dunno how I would go about checking for a release of the button.

Share this post


Link to post
Share on other sites

cameronsdad meant more like this:

#Include <Misc.au3>

While 1
    While _IsPressed("01")
        ToolTip("Button down")
        Sleep(10)
    WEnd
    ToolTip("Button up")
    Sleep(10)
WEnd

;)

Share this post


Link to post
Share on other sites

or

#Include <Misc.au3>

While 1
    If _IsPressed("01")Then
        While _IsPressed("01")
            ToolTip("Button down")
            Sleep(10)
        WEnd
    ToolTip("Button up")
    EndIf
    Sleep(10)
WEnd

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

or

Thanks, got that working ;)

Though, how do I get the tooltips to disappear again, now I got it hanging on my screen and cant get it away :)

Share this post


Link to post
Share on other sites

Thanks, got that working ;)

Though, how do I get the tooltips to disappear again, now I got it hanging on my screen and cant get it away :)

just call Tooltip() without an argument

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

Thanks.

Share this post


Link to post
Share on other sites

Thanks.

No problem, glad to help

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

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