Microsoft.Xna.Framework.Input.KeyboardState.GetPressedKeys C# (CSharp) Méthode

GetPressedKeys() public méthode

public GetPressedKeys ( ) : Keys[]
Résultat Keys[]
        public Keys[] GetPressedKeys() { return Empty; }
    }

Usage Example

 public void Update()
 {
     if (doInitDelay)
     {
         initialDelay--;
     }
     if (initialDelay <= 0)
     {
         doInitDelay = false;
         currentCommand = new NullCommand();
         keyboardState = Keyboard.GetState();
         foreach (Keys key in keyboardState.GetPressedKeys())
         {
             if (commandLibrary.ContainsKey(key))
             {
                 currentCommand = commandLibrary[key];
                 currentCommand.Execute();
                 break;
             }
         }
         if (keyboardState.GetPressedKeys().Length == 0)
         {
             player.Idle();
         }
     }
 }
All Usage Examples Of Microsoft.Xna.Framework.Input.KeyboardState::GetPressedKeys