Merge pull request #1322 from StephenMcConnel/bug23532
authorZoltan Varga <vargaz@gmail.com>
Fri, 5 Dec 2014 19:07:20 +0000 (14:07 -0500)
committerZoltan Varga <vargaz@gmail.com>
Fri, 5 Dec 2014 19:07:20 +0000 (14:07 -0500)
Remove excessive shortcut key matching in ToolStrip

mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStrip.cs

index 30c0d89f5fb40633ee7a05e3dc555e6408b74e67..6cfe4b2ecf896bf96db3ad83bf96b18291ead7de 100644 (file)
@@ -1145,13 +1145,7 @@ namespace System.Windows.Forms
                                if (tsi.Enabled && tsi.Visible && !string.IsNullOrEmpty (tsi.Text) && Control.IsMnemonic (charCode, tsi.Text))
                                        return tsi.ProcessMnemonic (charCode);
 
-                       string code = Char.ToUpper (charCode).ToString ();
-                       
-                       // If any item's text starts with our letter, it gets the message
-                       if ((Control.ModifierKeys & Keys.Alt) != 0 || this is ToolStripDropDownMenu)
-                               foreach (ToolStripItem tsi in this.Items)
-                                       if (tsi.Enabled && tsi.Visible && !string.IsNullOrEmpty (tsi.Text) && tsi.Text.ToUpper ().StartsWith (code) && !(tsi is ToolStripControlHost))
-                                               return tsi.ProcessMnemonic (charCode);
+                       // Do not try to match any further here.  See Xamarin bug 23532.
 
                        return base.ProcessMnemonic (charCode);
                }