/// <summary> /// Processes a dialog key. /// </summary> /// <param name="keyData">One of the Keys values that represents the key to process.</param> /// <returns>True is handled; otherwise false.</returns> protected override bool ProcessDialogKey(Keys keyData) { // Grab the controlling control that is a parent Control c = _ribbon.GetControllerControl(this); // Grab the view manager handling the focus view ViewBase focusView = null; if (c is VisualPopupGroup popGroup) { ViewRibbonPopupGroupManager manager = (ViewRibbonPopupGroupManager)popGroup.GetViewManager(); focusView = manager.FocusView; } else if (c is VisualPopupMinimized minimized) { ViewRibbonMinimizedManager manager = (ViewRibbonMinimizedManager)minimized.GetViewManager(); focusView = manager.FocusView; } // When in keyboard mode... if (focusView != null) { // We pass movements keys onto the view switch (keyData) { case Keys.Tab | Keys.Shift: case Keys.Tab: case Keys.Left: case Keys.Right: case Keys.Up: case Keys.Down: case Keys.Space: case Keys.Enter: _ribbon.KillKeyboardKeyTips(); focusView.KeyDown(new KeyEventArgs(keyData)); return(true); } } return(base.ProcessDialogKey(keyData)); }