Jump to content
Sign in to follow this  
Werty

Detect mouse button release ?

Recommended Posts

Werty

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
seandisanti

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

Share this post


Link to post
Share on other sites
Werty

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
Werty

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
AdmiralAlkex

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
Werty

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
seandisanti

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

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.