New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
right-mouse click in IDLE on Mac doesn't work #68989
Comments
For popup menus, control-click works, but right-click on mouse buttons that support it, doesn't work. This is a followup to bpo-10404, last addressed in 2010. As noted there, right click behaviour should be supported. The right click Tk text bindings on Mac (which is B2) seem to bind both to the virtual 'PasteSelection' event, and also to fast-scroll through a large file is you click and drag with the right mouse button. Both of these are blatant problems with Tk's text.tcl. The issue when trying to fix this before was when a B2 (context menu) binding was added to the text widget, both that and the bogus B2 bindings fired. This is because Tk can fire multiple bindings for a widget (default is bindings for the widget itself, the widget's toplevel, the widget's class, and 'all'). There is a way to short-circuit this in Tcl (basically the widget-specific binding calls 'break', which prevents the others from firing). The simpler alternative is probably just redefining the alternative class-level (Text) bindings. In other words, yeah, this should be pretty easily fixable. |
From your description, I an not sure what it is that does not work. |
If you have your mouse set up to have two buttons, right-clicking in the editor window doesn't bring up the context menu it's supposed to. |
Have attached macpopup.patch which removes the incorrect Tk behaviour and makes it so that right click on Mac will bring up the context menu as appropriate. |
Looks as right button on Mac corresponds to middle button on X Window (paste selection and scroll if moved). This behavior is standard for all Tk applications. I don't think we should break this. |
There is no notion of middle button on Mac, hence right button is B2. It's documented. Current Tk 8.6 has even removed the <<PasteSelection>> binding from B2 on Aqua because of this (I've filed a Tk bug report to backport this to 8.5). 8.6 also defines a <<ContextMenu>> virtual event, which on Mac is tied to B2. Mac UI guidelines define use of 'right button' (when available) to be used for context menu clicks. So yeah, we should change this. :-) |
Ah, so this is a workaround of 8.5- bug. Then looks reasonable to me. Added comments on Rietveld. |
Have attached macpopup-revised.patch, incorporating Serhiy's very helpful suggestions. Unless there are any other thoughts, this one is probably ready to go. |
Serhiy, thanks for the review. I bungled the issue number on the commit message, so here are the commit notices. Will correct for NEWS. New changeset b79dd0d7dc98 by Terry Jan Reedy in branch '2.7': New changeset 51b2b1a821b7 by Terry Jan Reedy in branch '3.4': |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: