Plug in joystick 0
Plug in joystick 1
Unplug joystick 0
Replug joystick 0
Joystick.LastConnectedIndex returns 1 instead of 0
Minimal Example Repo
No response
Expected Behavior
Joystick.LastConnectedIndex should return the index of the last joystick that was connected, or the name of the property should be changed to reflect this.
Resulting Behavior
Joystick.LastConnectedIndex returns the highest index of all the connected joysticks.
Maybe LastConnectedIndex should increase every time when joystick plugged?
I mean after replug joystick 0 (last step of reproduce) LastConnectedIndex should be 2?
Prerequisites
develop
branchMonoGame Version
MonoGame 3.8.1.303
Which MonoGame platform are you using?
MonoGame Cross-Platform Desktop Application (mgdesktopgl)
Operating System
Linux
Description
Joystick.LastConnectedIndex
returns the highest index in the joystick dictionary and this is not necessarily the last connected joystick. https://github.com/MonoGame/MonoGame/blob/81ed391a4d0fd81e3ee4bfe2492ad9a0e7f4cfc5/MonoGame.Framework/Platform/Input/Joystick.SDL.cs#L29-L33 https://github.com/MonoGame/MonoGame/blob/81ed391a4d0fd81e3ee4bfe2492ad9a0e7f4cfc5/MonoGame.Framework/Platform/Input/Joystick.SDL.cs#L73-L77Steps to Reproduce
Plug in joystick 0 Plug in joystick 1 Unplug joystick 0 Replug joystick 0
Joystick.LastConnectedIndex
returns 1 instead of 0Minimal Example Repo
No response
Expected Behavior
Joystick.LastConnectedIndex
should return the index of the last joystick that was connected, or the name of the property should be changed to reflect this.Resulting Behavior
Joystick.LastConnectedIndex
returns the highest index of all the connected joysticks.Files
No response