void KeyboardManager_KeyDown(object source, SingleKeyEventArgs e) { if (_isHoverable && CallKeyboardClickEvent && Visible && _isSelected && e.Key == Keys.Enter && !XnaExtensions.IsGuideVisible) { FireClicked(); } }
/// <summary> /// Called when a key is pressed down. /// </summary> /// <param name="source">Null source (KeyboardManager is static).</param> /// <param name="e">The event arguments containing data for this event.</param> void KeyboardManager_KeyDown(object source, SingleKeyEventArgs e) { if (e.Key == Keys.Escape) { SetScreen("MainMenu"); } }
void KeyboardManager_KeyDown(object source, SingleKeyEventArgs e) { if (Visible && e.Key == Keys.R) { foreach (LocalNetworkGamer gamer in GLibXNASampleGame.Instance.SessionManagement.Session.LocalGamers) { gamer.IsReady = !gamer.IsReady; } } else if (Visible && (e.Key == Keys.Space || e.Key == Keys.Enter) && GLibXNASampleGame.Instance.SessionManagement.Session.AllGamers.Count >= 2 && GLibXNASampleGame.Instance.SessionManagement.Session.IsHost && GLibXNASampleGame.Instance.SessionManagement.Session.SessionState == NetworkSessionState.Lobby && GLibXNASampleGame.Instance.SessionManagement.Session.IsEveryoneReady) { GLibXNASampleGame.Instance.SessionManagement.Session.StartGame(); } }
void KeyboardManager_KeyDown(object source, SingleKeyEventArgs e) { if (Visible && e.Key == Keys.Space) { if (video.Video.State == MediaState.Playing) { video.Video.Pause(); } else { video.Video.Resume(); } } }