/// <summary> /// Update the state of the given button /// </summary> /// <param name="button">The button which will be evaluated</param> /// <param name="pressed">true if the button is pressed</param> private void UpdateButton(Buttons button, bool pressed) { GamepadButton gamepadButton = this[button]; gamepadButton.Update(pressed); if (gamepadButton.Pressed) { if (this.Pressed != null) { this.Pressed(this, gamepadButton); } } else if (gamepadButton.Released) { if (this.Released != null) { this.Released(this, gamepadButton); } } }
/// <summary> /// Buttons the pressed. /// </summary> /// <param name="sender">The sender.</param> /// <param name="button">The button.</param> private void ButtonPressed(GamepadDevice sender, GamepadButton button) { this.strings.AppendLine(String.Format("Pressed: {0}", button.Button)); }