LT and RT triggers not reacting after recent update

I’m using Xbox One gamepad on Android phone connected by bluetooth (and several other compatible gamepads).

Some time ago I’ve updated VisualStudio. I’m not really sure, which components got updated.
Since then, my Android game build does not react to LT and RT triggers (Windows, Linux and Mac builds are still fine).

Things I’ve tried so far:

  1. Making a fresh Android Monogame project (still doesn’t work).
  2. Testing other apps on my phone (triggers register fine).
  3. Upgrading Monogame from 3.8.0. to 3.8.1 (no difference).
  4. Changing the code, looking at GamePadState at debugger, etc…

I’m kinda out of ideas at this point.
Did anyone have this problem?

To replicate the problem:

  1. Create new MonoGame Android Application.
  2. Paste the code below.
  3. Connect Android phone with bluetooth gamepad connected.
  4. Run the app and try pressing the triggers.

Game1.cs code:

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;

namespace android_test_project_monogame
{
    public class Game1 : Game
    {
        private GraphicsDeviceManager _graphics;
        private SpriteBatch _spriteBatch;

        public Game1()
        {
            _graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";
            IsMouseVisible = true;
        }

        protected override void Initialize()
        {
            // TODO: Add your initialization logic here

            base.Initialize();
        }

        protected override void LoadContent()
        {
            _spriteBatch = new SpriteBatch(GraphicsDevice);

            // TODO: use this.Content to load your game content here
        }

        protected override void Update(GameTime gameTime)
        {
           //  if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape))
             //   Exit();

            // TODO: Add your update logic here

            base.Update(gameTime);
        }

        protected override void Draw(GameTime gameTime)
        {
            Color color = Color.CornflowerBlue;

            if (GamePad.GetState(PlayerIndex.One).IsButtonDown(Buttons.LeftShoulder)) color = Color.Violet; // works
            if (GamePad.GetState(PlayerIndex.One).IsButtonDown(Buttons.RightShoulder)) color = Color.Red; // works

            if (GamePad.GetState(PlayerIndex.One).IsButtonDown(Buttons.LeftTrigger)) color = Color.White; // doesn't work on Android
            if (GamePad.GetState(PlayerIndex.One).IsButtonDown(Buttons.RightTrigger)) color = Color.Yellow; // doesn't work on Android

            if (GamePad.GetState(PlayerIndex.One).Triggers.Left > 0.5f) color = Color.White; // doesn't work on Android
            if (GamePad.GetState(PlayerIndex.One).Triggers.Right > 0.5f) color = Color.Yellow; // doesn't work on Android

            GraphicsDevice.Clear(color);

            base.Draw(gameTime);
        }
    }
}

That is the last change related to Triggers.
#7930
If anyone can investigate…

1 Like

I’ve installed Visual Studio on Windows 11 (I’m using Win10 on my main machine).
Fresh install and all.

Unfortunately, the problem persists. Triggers do not react.

I don’t think that windows have anything to do with this, but on the other hand I am not sure about the nature of the problem.

It could be a change in xamarin or the android abi you are building it against (18?).
You need to ask the original poster of the PR if there is a workaround.
Or you could wait for the next release, or build the library from source.