In Mac OS, when can a mouse right click not be identical to a control-click?

Viewed 72

I'm building a custom context menu in vanilla Javascript for a web app. Using the current version of Safari (15.5) on Monterey 12.4, it works just as it should when the user right clicks (i.e. clicks using the right side of Magic Mouse), but does something different when the user holds down the control key and left clicks. The puzzle is that it seems that these two actions should be identical in their effect. (I think that one difference is that control-click generates a contextmenu event and a click event).

In contrast, Chrome (v101.0.4951.64) just produces a contextmenu event for a control-click, the same as for a right click.

I have 'Secondary click' ticked in System Preferences > Mouse > Point & Click.

Is this a bug in Safari, or something weird about my system? Any suggestions for how to work around this (just ignoring the extra click won't work, because left click on the element is used for another function)?

0 Answers
Related