Left click or right click in picture


In my project I use a canvas area for graphical display.

Into this canvas I use the mouse to access to a contextual menu and for designing items (lines, circles etc…).
Normally the left click is designing object and right click for menu access.

But into the events list of the canvas I just see a “mousedown” event and nothing evident for made the difference between left click from right click ?

How can I do that ?

Thanks and regards.

Look for ContextualMenu in the documentation; they are two events to implement: one for contruct the Menu, the second for executing the code…

Check IsContextualClick in MouseDown.

if IsContextualClick then
   // right click
   // left click
1 Like

Thanks Tim and Emile.
That s exactly the information I need.