public override void HandleInput(GameTime gameTime)
        {
            InputComponent input =
                FrameworkCore.InputManager.GetInputComponent(PlayerIndex.One);

            if (loadNextScreenGraphicsContent)
            {
                //  Press A to Continue.
                if (input.IsStrokeControlPad(ControlPad.A) ||
                    input.IsStrokeControlPad(ControlPad.Start) ||
                    input.IsStrokeKey(Keys.Space) ||
                    (!input.IsPressKey(Keys.LeftAlt) &&
                     !input.IsPressKey(Keys.RightAlt) &&
                     input.IsStrokeKey(Keys.Enter)))
                {
                    ExitScreen();
                }
            }
        }
Exemple #2
0
        /// <summary>
        /// checks whether specified key has been pressed only once.
        /// </summary>
        /// <param name="key">game key in the game</param>
        /// <returns></returns>
        public bool IsStrokeKey(GameKey key)
        {
            if (input.IsConnectedControlPad &&
                input.IsStrokeControlPad(TranslateToControlPad(key)))
            {
                return(true);
            }

            return(input.IsStrokeKey(TranslateToKeyboard(key)));
        }