Sign in to follow this  
Followers 0
Hawkwing

button clicked with right or left

2 posts in this topic

How do you tell if a button was clicked with the right or left mouse button?


The Wheel of Time turns, and Ages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Age that gave it birth comes again.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

you could use these

$GUI_EVENT_PRIMARYDOWN the primary mouse button was pressed.

$GUI_EVENT_PRIMARYUP the primary mouse button was released.

$GUI_EVENT_SECONDARYDOWN the secondary mouse button was pressed.

$GUI_EVENT_SECONDARYUP the secondary mouse button was released.

and set an Small invisible GUI over the button Something like this eample script gave to me some time ago,

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Global $hGUI1, $hGUI2

$hGUI1 = GUICreate('Test', 200, 200)
GUISetState()
$hGUI2 = GUICreate('', 100, 100, 50, 50, $WS_CHILD, 0, $hGUI1)
GUISetState()

While 1
    Local $aMsg = GUIGetMsg(1)
    Switch $aMsg[0]
        Case $GUI_EVENT_PRIMARYUP
            If $aMsg[1] = $hGUI1 Then
                MsgBox(0, '', 'GUI1')
            Else
                MsgBox(0, '', 'GUI2')
            EndIf
            
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

tells if you clicked wiht the left mouse button down in the center of the GUI

I TAKE NO CREDIT FORTHIS

ahha

Edited by liten

My UDF:Freeze.au3-Freeze values like CE, ML, ETC[i][/i][u][/u]

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