public override void HandleInput(InputState input) { base.HandleInput(input); }
/// <summary> /// Handles user input for all the local gamers in the session. Unlike most /// screens, which use the InputState class to combine input data from all /// gamepads, the lobby needs to individually mark specific players as ready, /// so it loops over all the local gamers and reads their inputs individually. /// </summary> public override void HandleInput(InputState input) { foreach (LocalNetworkGamer gamer in networkSession.LocalGamers) { PlayerIndex playerIndex = gamer.SignedInGamer.PlayerIndex; if (input.IsMenuSelect(playerIndex)) { HandleMenuSelect(gamer); } else if (input.IsMenuCancel(playerIndex)) { HandleMenuCancel(gamer); } if (input.IsNewKeyPress(Keys.Tab)) { // Get some message from the user to send. Guide.BeginShowKeyboardInput(playerIndex, "Send Message", "Type the message you wish to broadcast.", "", SendMessage, null); } } }
/// <summary> /// Responds to user input, changing the selected entry and accepting /// or cancelling the menu. /// </summary> public override void HandleInput(InputState input) { // Move to the previous menu entry? if (input.MenuUp) { selectedEntry--; if (selectedEntry < 0) selectedEntry = menuEntries.Count - 1; } // Move to the next menu entry? if (input.MenuDown) { selectedEntry++; if (selectedEntry >= menuEntries.Count) selectedEntry = 0; } // Accept or cancel the menu? if (input.MenuSelect) { if(isRespawnScreen == false) OnSelectEntry(selectedEntry); } else if (input.MenuCancel) { if (isRespawnScreen == false) OnCancel(); } }
/// <summary> /// Responds to user input, accepting or cancelling the message box. /// </summary> public override void HandleInput(InputState input) { if (input.MenuSelect) { // Raise the accepted event, then exit the message box. if (Accepted != null) Accepted(this, EventArgs.Empty); ExitScreen(); } else if (input.MenuCancel) { // Raise the cancelled event, then exit the message box. if (Cancelled != null) Cancelled(this, EventArgs.Empty); ExitScreen(); } }
/// <summary> /// Allows the screen to handle user input. Unlike Update, this method /// is only called when the screen is active, and not when some other /// screen has taken the focus. /// </summary> public virtual void HandleInput(InputState input) { }