Treat Alt/Ctrl+Left Click as Right/Middle Click
Original Reporter info from Mantis: zpeterson @boramis
-
Reporter name: Zoë Peterson
Original Reporter info from Mantis: zpeterson @boramis
- Reporter name: Zoë Peterson
Description:
Cocoa apps all treat Ctrl+Left Click as a Right Click and Option+Left Click as a Middle Click. Ctrl+left clicking should bring up the context menu, for example, and Option+Clicking in Safari will open a link in a new tab. LCLCARBON mapped the buttons automatically, and this patch does the same thing for LCLCOCOA.
In LCLCARBON, you could distinguish the fake state by looking at the TShiftState instead of the TMouseButton, and I've kept that behavior here. So:
Left Click => mbLeft + []
Ctrl+Right Click => mbRight + [ssCtrl, ssRight]
Ctrl+Left Click => mbRight + [ssCtrl, ssLeft]
We never use that fact, but it seemed reasonable to keep it.
Steps to reproduce:
Using the attached sample project, left click, right click, and ctrl+left click on the form. The window caption will change to indicate what's currently being passed in, and it will show a context menu on a right click.
In LCLCARBON, Ctrl+Left Click is reported as mbRight + [ssCtrl, ssLeft]. In the current LCLCOCOA, it's reported as mbLeft + [ssCtrl, ssLeft] and it doesn't show the context menu.
Mantis conversion info:
- Mantis ID: 35986
- Version: 2.0.4