Jump to content

GuiButton down


ChrisL
 Share

Recommended Posts

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.

Link to comment
Share on other sites

  • Moderators

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

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.

Link to comment
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

Link to comment
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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...