You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to Apple support page, there are two ways to right-click in macOS:
Control-click an item
Press and hold the Control key while clicking an item using mouse or trackpad.
Control-click items using only mouse/trackpad
Need to change its settings to open "Secondary click". Details in Apple support page.
After testing, opencv incorrectly maps the first type of right-click as EVENT_LBUTTONDOWN/EVENT_LBUTTONUP.
This is because NSEvent.EventType does not automatically map control-click into a right-click. Developers need to handle this mapping themselves. Similar codes can be found in chromium.
I can submit a pull request to fix it, or update the documentation to give users the option. However, please note that the second type of right-click mentioned above is disabled by default and must be enabled manually in the settings. The mapping of control-click to right-click is likely a common understanding among most macOS users.
System Information
OpenCV version: build from https://github.com/opencv/opencv/tree/d9a139f9e85a17b4c47dbca559ed90aef517c279
Operating System / Platform: macOS 15.2
Python version: 3.12
Detailed description
There is a comment left in
highgui/src/window_cocoa.mm
:opencv/modules/highgui/src/window_cocoa.mm
Lines 992 to 996 in dbb330d
According to Apple support page, there are two ways to right-click in macOS:
Press and hold the Control key while clicking an item using mouse or trackpad.
Need to change its settings to open "Secondary click". Details in Apple support page.
After testing, opencv incorrectly maps the first type of right-click as EVENT_LBUTTONDOWN/EVENT_LBUTTONUP.
This is because
NSEvent.EventType
does not automatically map control-click into a right-click. Developers need to handle this mapping themselves. Similar codes can be found in chromium.I can submit a pull request to fix it, or update the documentation to give users the option. However, please note that the second type of right-click mentioned above is disabled by default and must be enabled manually in the settings. The mapping of control-click to right-click is likely a common understanding among most macOS users.
Steps to reproduce
Issue submission checklist
The text was updated successfully, but these errors were encountered: