From: Kevin W. <kw...@co...> - 2017-05-01 10:52:04
|
On 4/30/17 11:04 PM, Trevor Williams wrote: > I am seeing an issue with Tcl/Tk version 8.5.19 on Mac (I don’t see > the same issue on X11) where assigning a keyboard shortcut to a main > menu option (via the -accelerator option to the menu item), creating a > bind statement to invoke the menu when the keyboard shortcut is used, > and the using the keyboard shortcut causes the menu to be run twice. > > I have attached a test file which exhibits this issue. To run the > test, run Wish, source the test file, place keyboard focus on the > resulting text widget in the main window, and use the keyboard > shortcut Control-Shift-. I have also seen this issue with > Control-Shift-, (though I haven’t done any “exhaustive” testing to see > what combinations of modifiers/symbols cause the double event and > which do not). If you changed the keyboard shortcut to something like > Command-n or something (and change the matching binding, of course), > only one event would be generated (this is the expected behavior). I see the behavior, and one thing that immediately comes to mind is that you are using Control-Shift- as the accelerator and Control-Shift-Key-Greater as the binding: those are two different accelerators. In my apps I set accelerators such as Control-P and then bind all Control-P. I wonder if the control-shift is inadvertently causing the event to fire twice. Any reason for the mismatch between accelerators? --Kevin -- Kevin Walzer Code by Kevin/Mobile Code by Kevin http://www.codebykevin.com http://www.wtmobilesoftware.com |