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
{{ message }}
Repository navigation
[Bug]: macOS backend reports wrong button for button_release_event #31899
I have tried to investigate the history of "alt+click" emulating a middle click. While control+click is a standard shortcut on macOS for a right click, alt+click has no system-default meaning.
As far as I can tell, this probably originated with Apple's XQuartz X11 server. There is a "enable_fake_buttons" default that can be enabled. By default, it is off. It is unclear if "Button 2" and "Button 3" as mentioned in the man page correspond to 2=middle/3=right or 2=right/3=middle. Various open-source projects running on darwin map these differently.
As this behavior dates back to the original inclusion of _macosx.m in the project from 2008. My assumption is that the original author used the XQuartz or a similar environment with alt+click set to emulate a middle mouse button.
If this is the case, I don't believe that this behavior should be propagated to other backends. In addition, I'm more inclined to have the macosx backend only map control+click to a right click (as qtagg does). I'm not sure if others have strong opinions.
Activity
[Bug]: qtagg reports wrong button when Option is released before the …
iccir commentedon Jul 15, 2026
I have tried to investigate the history of "alt+click" emulating a middle click. While control+click is a standard shortcut on macOS for a right click, alt+click has no system-default meaning.
As far as I can tell, this probably originated with Apple's XQuartz X11 server. There is a "enable_fake_buttons" default that can be enabled. By default, it is off. It is unclear if "Button 2" and "Button 3" as mentioned in the man page correspond to 2=middle/3=right or 2=right/3=middle. Various open-source projects running on darwin map these differently.
As this behavior dates back to the original inclusion of
_macosx.min the project from 2008. My assumption is that the original author used the XQuartz or a similar environment with alt+click set to emulate a middle mouse button.If this is the case, I don't believe that this behavior should be propagated to other backends. In addition, I'm more inclined to have the macosx backend only map control+click to a right click (as qtagg does). I'm not sure if others have strong opinions.
Add _emulatedLeftMouseDownButton for matplotlib#31899