Right click with two fingers click (macOs)

Hi,

I am so used to do the right-click by the two fingers click on the trackpad that I want to add this to my desktop app. In particular, I have a DesktopListBox with multiple row selection. If I select more than one row and I use ctrl+click works, but if I use the two fingers method it looses the selection, as if I single-clicked the listbox before right-clicking on it. Has anyone figured out how to solve it?

Thanks,
Davide.

Look in the documentation for ContextualMenu (same as right-click)…

I meant “Same as Ctrl-Click”…

In the MouseDown event you can check “IsContextualClick” property to know if the user “right clicked” or “Two fingers clicked” and then decide what to do.

This is what I do. But if I use the two finger click I loose the (multiple) selection, whereas if I ctrl-click everything is working fine

Two Fingers on the Finder (two selected folders) does not unselect the items (and display the ContextualMenu).

But, Right-Click (with MY mouse) sometimes jiggles…

Check in your trackpad settings. Do you have the two finger click turned on?

Are you using “Return True” when you detect “IsContextualClick” in order to prevent the control from continuing the click action?

What I did to solve this in the past was to record the selected items in the contextual click event and then restore the selection after the event.

I did something similar to what you did, but I also took care of PaintCellBackground to highlight the cells.
Thank you all.