private void _keyboardHook_KeyUp(object sender, KeyEventArgs e) { //base.OnKeyUp(e); if (e.KeyCode == Keys.Down) { RibbonItem NextItem = null; RibbonItem SelectedItem = null; foreach (RibbonItem itm in MenuItems) { if (itm.Selected) { SelectedItem = itm; break; } } if (SelectedItem != null) { //get the next item in the chain int Index = MenuItems.IndexOf(SelectedItem); NextItem = GetNextSelectableMenuItem(Index + 1); } else { //nothing found so lets search through the recent buttons foreach (RibbonItem itm in RecentItems) { if (itm.Selected) { SelectedItem = itm; itm.SetSelected(false); itm.RedrawItem(); break; } } if (SelectedItem != null) { //get the next item in the chain int Index = RecentItems.IndexOf(SelectedItem); NextItem = GetNextSelectableRecentItem(Index + 1); } else { //nothing found so lets search through the option buttons foreach (RibbonItem itm in OptionItems) { if (itm.Selected) { SelectedItem = itm; itm.SetSelected(false); itm.RedrawItem(); break; } } if (SelectedItem != null) { //get the next item in the chain int Index = OptionItems.IndexOf(SelectedItem); NextItem = GetNextSelectableOptionItem(Index + 1); } } } //last check to make sure we found a selected item if (SelectedItem == null) { //we should have the right item by now so lets select it NextItem = GetNextSelectableMenuItem(0); if (NextItem != null) { NextItem.SetSelected(true); NextItem.RedrawItem(); } } else { SelectedItem.SetSelected(false); SelectedItem.RedrawItem(); NextItem.SetSelected(true); NextItem.RedrawItem(); } //_sensor.SelectedItem = NextItem; //_sensor.HittedItem = NextItem; } else if (e.KeyCode == Keys.Up) { } }