Ned Deily <[email protected]> added the comment:
The actual unwanted event is being generated as a result of the menu "add
command" accelerator. You can see that by playing with Wish.
set w .menu
catch {destroy $w}
toplevel $w
wm title $w "Menu Shift"
menu $w.menu -tearoff 0
set m $w.menu.basic
$w.menu add cascade -label "Basic" -menu $m -underline 0
menu $m -tearoff 0
$m add command -label "Test" \
-command "puts command" -accelerator Command-Shift-A
bind $w <Command-Shift-A> "puts bind"
$w configure -menu $w.menu
It appears that there is a bug in the Cocoa Tk right now where accelerators
with "Shift" (at least) in them are not being properly ignored by Tk. In the
Carbon Tk and the X11 Tk, I believe the only effect of the "accelerator"
definitions on the "add command" is to be used to create the shortcut
characters displayed in the menu entry. However, apparently a side effect of
using the Cocoa APIs is that the menu definitions now cause notifications back
into Tk which are not supposed to be translated into Tcl/Tk events back to the
app. For some reason, the shift ones are not being ignored.
https://github.com/das/tcltk/blob/master/tk/macosx/tkMacOSXMenu.c
Also, it seems that with all three of the Tk implementations (Carbon, X11, and
Cocoa), using a capital letter for the menu accelerator implies Shift.
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue11055>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com