Selection right click

Hi,
I’m writing an application that requires most action be performed using right mouse click. However, I’ve noticed that right clicking the canvas de-selects the objects. Is there a way to remember the last selection?
Thank you.

There are (at least) two situations here, depending on whether the user context-clicks on a GoObject or in the background.
When the user context-clicks on a GoObject, the standard behavior is to make that object the only selected object (assuming it’s Selectable, of course). You can set GoView.ContextClickSingleSelection to false to change the behavior so that the context click does not change the Selection if the object being clicked on is already part of the Selection.
When the user context-clicks in the background, this clears the Selection.
If you want to change the behavior for either of these cases, you can override GoToolContext.DoSelect to implement whatever policy you want.

OK, Thank you!