Skip to content

Commit

Permalink
Clearing a gamepad now clears the vibration motor values too.
Browse files Browse the repository at this point in the history
  • Loading branch information
vchelaru committed Dec 9, 2023
1 parent 5161bc6 commit c9c952c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Engines/FlatRedBallXNA/FlatRedBall/Input/Xbox360Gamepad.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ public enum DeadzoneType
Radial = 0,
//BoundingBox = 1, // Not currently supported
Cross

}

/// <summary>
/// The button layout of the face and shoulder buttons. Xbox and Nintendo controllers swap the X/Y and A/B buttons.
/// </summary>
public enum ButtonLayout
{
Unknown,
Expand Down Expand Up @@ -1291,10 +1294,12 @@ public Button GetButtonFromPosition(ButtonPosition buttonPosition)

/// <summary>
/// Clears the input on this controller for this frame. This includes
/// analog stick values, button values, and trigger values.
/// analog stick values, button values, trigger values, and vibration motor values (resets to 0).
/// </summary>
public void Clear()
{
this.SetVibration(0, 0);

// do these before setting the states:
for (int i = 0; i < NumberOfButtons; i++)
{
Expand Down Expand Up @@ -1782,7 +1787,7 @@ private void UpdateAnalogStickAndTriggerValues()

private void UpdateInputManagerBack()
{
#if WINDOWS_PHONE || MONOGAME
#if MONOGAME
if (mGamePadState.IsButtonDown(Buttons.Back) && !mLastGamePadState.IsButtonDown(Buttons.Back))
{
InputManager.BackPressed = true;
Expand Down

0 comments on commit c9c952c

Please sign in to comment.