SidebarLibrary.Menus.MenuControl.OnKeyUp C# (CSharp) Method

OnKeyUp() protected method

protected OnKeyUp ( KeyEventArgs e ) : void
e System.Windows.Forms.KeyEventArgs
return void
		protected override void OnKeyUp(KeyEventArgs e)
		{
			switch(e.KeyCode)
			{
				case Keys.Escape:
					if (_manualFocus)
					{
						if (!_selected)
						{
							// Did we see the key down for escape? If not then the
							// escape must have been used to dismiss a popup menu
							if (!_ignoreEscapeUp)
							{
								// No longer in manual focus mode
								_manualFocus = false;

								// Remove tracking of any item
								_trackItem = SwitchTrackingItem(_trackItem, -1);

								// Send the focus back to origin
								ReturnTheFocus();
							}
						}
					}

					_ignoreEscapeUp = false;

					break;
				default:
					ProcessMnemonicKey((char)e.KeyValue);

					if (_selected)
						_ignoreMouseMove = true;
					break;
			}

			base.OnKeyUp(e);
		}