GamePadState gamepadState = GamePad.GetState(i, GamePadDeadZone.Circular) Protected override void Update(GameTime gameTime)įor (int i = 0 i < GamePad.MaximumGamePadCount i++)
_spriteBatch = new SpriteBatch(GraphicsDevice) _graphics.PreferredBackBufferHeight = 900 _graphics.PreferredBackBufferWidth = 1600 _graphics = new GraphicsDeviceManager(this) Here’s a simple MG Game class to test what I have described above (you will need a simple font content file to load to render the debug info - in this code it loads an Arial.xnb spritefont): using Tested with MonoGame 3.8 - DesktopGL on Windows 10 圆4 Seemingly not a driver-level bug, because Windows doesn’t report multiple copies of the Xbox device, and this only happens if you Init the program with both connected at the same time. I wonder if this is a MonoGame bug, an SDL bug, or perhaps something even deeper. If you disconnect the PS4 controller, the “ghost” remains until you restart the program (presumably, until MG/SDL/both have re-Init-ed). If you connect the PS4 controller after the program starts (presumably, after MG/SDL have initialized), then everything works as expected, but if the programs starts with the PS4 controller and other controller connected you can see the bug. If you disconnect the Xbox controller and reconnect, then the new one will work as expected, but leaves behind the “ghost” duplicate that does not report button presses or anything.
On 2 different GamePad indexes, and both report button presses to polling and such. So what’s happening is that if you start a MonoGame program with a PS4 controller connected and some other controller (tested with Xbox 360 and Xbox One controllers), instead of MG reporting the PS4 and Xbox controller, there are 2 instances of the Xbox controller. If anyone can shed some light on this, it’d be super helpful.