示例#1
0
        private bool IsButtonPressed(InputButton Button, KeyboardState KS, GamePadState GS)
        {
            switch (Button.Type)
            {
            case InputMethod.Key:
                return(KS.IsKeyDown(Button.Key));

            case InputMethod.Button:
                return(GS.IsButtonDown(Button.Button));

            default:
                throw new ArgumentOutOfRangeException("Button.Type");
            }
        }
示例#2
0
 /// <summary>
 /// Registers the given InputButton to cause this Bind to be triggered.
 /// </summary>
 public void RegisterButton(InputButton Button)
 {
     this._Buttons.Add(Button);
 }
示例#3
0
 private bool IsButtonPressed(InputButton Button, KeyboardState KS, GamePadState GS)
 {
     switch(Button.Type) {
         case InputMethod.Key:
             return KS.IsKeyDown(Button.Key);
         case InputMethod.Button:
             return GS.IsButtonDown(Button.Button);
         default:
             throw new ArgumentOutOfRangeException("Button.Type");
     }
 }
示例#4
0
文件: Bind.cs 项目: Octanum/Corvus
 /// <summary>
 /// Unregisters the given InputButton from triggering this Bind.
 /// </summary>
 public void UnregisterButton(InputButton Button)
 {
     bool result = this._Buttons.Remove(Button);
     if(!result)
         throw new ArgumentException("Button was not associated with this Bind.");
 }
示例#5
0
文件: Bind.cs 项目: Octanum/Corvus
 /// <summary>
 /// Registers the given InputButton to cause this Bind to be triggered.
 /// </summary>
 public void RegisterButton(InputButton Button)
 {
     this._Buttons.Add(Button);
 }