Message131233
| Author |
ned.deily |
| Recipients |
ned.deily, ronaldoussoren |
| Date |
2011年03月17日.07:22:05 |
| SpamBayes Score |
4.296371e-09 |
| Marked as misclassified |
No |
| Message-id |
<1300346526.03.0.051871996453.issue11055@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2011年03月17日 07:22:06 | ned.deily | set | recipients:
+ ned.deily, ronaldoussoren |
| 2011年03月17日 07:22:06 | ned.deily | set | messageid: <1300346526.03.0.051871996453.issue11055@psf.upfronthosting.co.za> |
| 2011年03月17日 07:22:05 | ned.deily | link | issue11055 messages |
| 2011年03月17日 07:22:05 | ned.deily | create |
|