/// <summary> /// Called when the control should process keyboard information. /// </summary> /// <param name="info">The keyboard information.</param> /// <returns>True if the keyboard was handled by this control.</returns> public override bool ProcessKeyboard(Input.Keyboard info) { if (info.IsKeyReleased(Keys.Space) || info.IsKeyReleased(Keys.Enter)) { IsSelected = true; return(true); } else if (Parent != null) { if (info.IsKeyReleased(Keys.Up)) { Parent.TabPreviousControl(); } else if (info.IsKeyReleased(Keys.Down)) { Parent.TabNextControl(); } return(true); } return(false); }
/// <summary> /// Detects if the SPACE and ENTER keys are pressed and calls the <see cref="Click"/> method. /// </summary> /// <param name="info"></param> public override bool ProcessKeyboard(Input.Keyboard info) { if (info.IsKeyReleased(Keys.Space) || info.IsKeyReleased(Keys.Enter)) { DoClick(); return(true); } return(false); }
/// <summary> /// Focuses the previous or next selection button depending on if the UP or DOWN arrow keys were pressed. /// </summary> /// <param name="info">The keyboard state.</param> public override bool ProcessKeyboard(Input.Keyboard info) { if (info.IsKeyReleased(Keys.Up) && PreviousSelection != null) { PreviousSelection.IsFocused = true; return(true); } else if (info.IsKeyReleased(Keys.Down) && NextSelection != null) { NextSelection.IsFocused = true; return(true); } return(base.ProcessKeyboard(info)); }
/// <summary> /// Focuses the previous or next selection button depending on if the UP or DOWN arrow keys were pressed. /// </summary> /// <param name="info">The keyboard state.</param> public override bool ProcessKeyboard(Input.Keyboard info) { if (info.IsKeyReleased(Keys.Up)) { SelectPrevious(); return(true); } else if (info.IsKeyReleased(Keys.Down)) { SelectNext(); return(true); } return(base.ProcessKeyboard(info)); }