GameStateManagement.InputState.IsMenuCancel C# (CSharp) Method

IsMenuCancel() public method

Checks for a "menu cancel" input action. The controllingPlayer parameter specifies which player to read input for. If this is null, it will accept input from any player. When the action is detected, the output playerIndex reports which player pressed it.
public IsMenuCancel ( ) : bool
return bool
        public bool IsMenuCancel()
        {
            return IsNewKeyPress(Keys.Escape);
        }

Usage Example

        public override void HandleInput(InputState input)
        {
            PlayerIndex player;
            if (input.IsNewButtonPress(Buttons.Y, ControllingPlayer, out player))
            {
            #if XBOX
                Debug.Assert (ControllingPlayer != null);
                HighScores2.GoLoad(ControllingPlayer ?? PlayerIndex.One);
            #else

                HighScores2.DoWindowsLoadGame();
            #endif

                ScreenManager.AddScreen(new HighScoreScreen(), ControllingPlayer);
            }

            if (input.IsMenuCancel(ControllingPlayer, out player))
            {
                MediaPlayer.Stop();
            }

            songSelectionBox.HandleInput(input);
            if (songSelectionBox.SongCount <= 0 &&
                input.IsNewButtonPress(Buttons.A, null, out player))
            {
                return;
            }
            base.HandleInput(input);
        }
All Usage Examples Of GameStateManagement.InputState::IsMenuCancel