private void KeyDownRibbon(KeyEventArgs e)
{
ViewBase newView = null;
switch (e.KeyData)
{
case Keys.Tab:
case Keys.Right:
// Ask the ribbon to get use the next view for the qat
newView = Ribbon.GetNextQATView(Target, (e.KeyData == Keys.Tab));
break;
case Keys.Tab | Keys.Shift:
case Keys.Left:
// Ask the ribbon to get use the previous view for the qat
newView = Ribbon.GetPreviousQATView(Target);
break;
case Keys.Space:
case Keys.Enter:
// Exit keyboard mode when you click the button spec
Ribbon.KillKeyboardMode();
// Generate a click event
OnClick(new MouseEventArgs(MouseButtons.Left, 1, 0, 0, 0));
break;
}
// If we have a new view to focus and it is not ourself...
if ((newView != null) && (newView != Target))
{
// If the new view is a tab then select that tab
if ((newView is ViewDrawRibbonTab) && !Ribbon.RealMinimizedMode)
Ribbon.SelectedTab = ((ViewDrawRibbonTab)newView).RibbonTab;
// Finally we switch focus to new view
Ribbon.FocusView = newView;
}
}