Guest opa-gust Posted August 26, 2005 Share Posted August 26, 2005 Hi, I'm a new user and working on my first script.The problem is: I want to make a distinction between a normal click and a right-click. For a right-click, the event $GUI_EVENT_SECONDARYDOWN seems appropriate, but :The description of the function GuiGetMsg in the Autoit Helpfile states: The "event" returned is the control ID of the control sending the message, or it is a special event So my question is : How to obtain both the control_id and the special event at the same time? Link to comment Share on other sites More sharing options...
seandisanti Posted August 26, 2005 Share Posted August 26, 2005 Hi, I'm a new user and working on my first script.The problem is: I want to make a distinction between a normal click and a right-click. For a right-click, the event $GUI_EVENT_SECONDARYDOWN seems appropriate, but :The description of the function GuiGetMsg in the Autoit Helpfile states: The "event" returned is the control ID of the control sending the message, or it is a special event So my question is : How to obtain both the control_id and the special event at the same time? <{POST_SNAPBACK}>tough call on this one. the GuiGetMsg only returns one or the other. one way you could kind of circumvent that would be to set a case that returns the control id from GuiGetMsg(), and also implements _IsPressed to check which if either of the mouse buttons are depressed. Link to comment Share on other sites More sharing options...
SumTingWong Posted August 26, 2005 Share Posted August 26, 2005 (edited) This should do the trick. #include <GUIConstants.au3> GUICreate("Test") $btn = GUICtrlCreateButton("Test", 20, 20) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE ExitLoop Case $GUI_EVENT_SECONDARYDOWN $aCursorInfo = GUIGetCursorInfo() ConsoleWrite($btn & " - " & $aCursorInfo[4] & @LF) EndSwitch WEnd GUIDelete() Edited August 26, 2005 by SumTingWong Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now