Sign in to follow this  
Followers 0
ChrisL

GuiButton down

5 posts in this topic

In a guiGetMsg() loop how do you detect that a control is down?

Normally you don't get a response until the button comes up (the mouse click is released) I want to know if the gui gives a respoce while the button is pressed please.

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

I believe you are going to have to make a custom option for this Chris... something with _IsPressed() + ControlGetFocus() + MouseGetPos() (or something relative to that)

Edit:

Looks like you could do it with GUIRegisterMsg() and:

BN_PUSHED

BN_UNPUSHED

Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

I believe you are going to have to make a custom option for this Chris... something with _IsPressed() + ControlGetFocus() + MouseGetPos() (or something relative to that)

Edit:

Looks like you could do it with GUIRegisterMsg() and:

BN_PUSHED

BN_UNPUSHED

Thanks Ron

Share this post


Link to post
Share on other sites

You know I think I just needed to sleep on it I have come up with this

Func _isButtonDown($button,$Gui="")

Local $cursor

$cursor = GUIGetCursorInfo ($Gui)

If IsArray($cursor) then 
    If $cursor[2] = 1 and $cursor[4] = $button then 
        
        Return 1
        
            Else
                
                Return 0
                
    EndIf
EndIf
EndFunc

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