private bool mSeenDoubleAlt; private System.Diagnostics.Stopwatch stopWatchAltKey = new System.Diagnostics.Stopwatch(); protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { if (keyData == (Keys.Control | Keys.O)) { Share.cmdMan.command(ConstantProvider.CMD_OPEN); return true; } else if (keyData == (Keys.Control | Keys.A)) { if (!Share.sdkProperties.IsInEditMode() && Share.dockPanel.ActiveDocument is SDKView) { Share.cmdMan.command(ConstantProvider.CMD_SELECTALL); return true; } } else if (keyData == (Keys.Control | Keys.F)) { if (!Share.sdkProperties.IsInEditMode() && Share.dockPanel.ActiveDocument is SDKView) { Share.cmdMan.command(ConstantProvider.CMD_SHA_PAS); return true; } } else if (keyData == (Keys.Control | Keys.G)) { if (!Share.sdkProperties.IsInEditMode() && Share.dockPanel.ActiveDocument is SDKView) { Share.cmdMan.command(ConstantProvider.CMD_SHA_INI); return true; } } else if (keyData == (Keys.Control | Keys.D0) || keyData == (Keys.Control | Keys.NumPad0)) { if (!Share.sdkProperties.IsInEditMode() && Share.dockPanel.ActiveDocument is SDKView) { Share.cmdMan.command(ConstantProvider.CMD_ZOOM100); return true; } } else if (keyData == (Keys.Control | Keys.Add) || keyData == (Keys.Control | Keys.Oemplus)) { if (!Share.sdkProperties.IsInEditMode() && Share.dockPanel.ActiveDocument is SDKView) { Share.cmdMan.command(ConstantProvider.CMD_ZOOMIN); return true; } } else if (keyData == (Keys.Control | Keys.Subtract) || keyData == (Keys.Control | Keys.OemMinus)) { if (!Share.sdkProperties.IsInEditMode() && Share.dockPanel.ActiveDocument is SDKView) { Share.cmdMan.command(ConstantProvider.CMD_ZOOMOUT); return true; } } else if (keyData == Keys.Back) { if (!Share.sdkProperties.IsInEditMode() && Share.dockPanel.ActiveDocument is SDKView) { Share.cmdMan.command(ConstantProvider.CMD_BACK); return true; } } else if (keyData == Keys.Delete) { if (!Share.sdkProperties.IsInEditMode() && Share.dockPanel.ActiveDocument is SDKView) { Share.cmdMan.command(ConstantProvider.CMD_DELETE); return true; } } else if (keyData == (Keys.Alt | Keys.ShiftKey | Keys.RButton)) { this.mSeenDoubleAlt = !this.mSeenDoubleAlt; if (!this.mSeenDoubleAlt) { stopWatchAltKey.Stop(); if (stopWatchAltKey.ElapsedMilliseconds < 500) { this.MainMenuStrip.Visible = !this.MainMenuStrip.Visible; stopWatchAltKey.Reset(); } else { stopWatchAltKey.Reset(); stopWatchAltKey.Start(); this.mSeenDoubleAlt = true; } } else stopWatchAltKey.Start(); return true; } this.mSeenDoubleAlt = false; return base.ProcessCmdKey(ref msg, keyData); }