Getting mouse event type inside an AddExec() function

I’m trying to make use of mouse events in my root .C macro. I want to key an action specifically on a mouse click event. Typically you add a call back function, which in this case you do with the AddExec() TCanvas member function. In the call back routine, I want to query what mouse event lead to the execution of the call back. What function do I call which would return the mouse event type?
Thanks.

May be this example can help:
https://root.cern/doc/master/exec1_8C.html

Thanks Couet. GetEvent() returns a 1 for a mouse click and an 11 for a mouse click release. It returns a 51 for a mouse move. I guess I could look through the code to see what the mouse events codes are, but for what I need to do, I can execute the code I want to execute on event type 1 or 11. Appreciate your reply, you saved me a lot of time rummaging through the tutorials.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.