Is it possible to get an array of all currently pressed GamePadState buttons similar to when using the function GetPressedKeys() from KeyboardState? Otherwise is there any way of suggesting a workaround that isn’t making my own custom enum/array for all the GamePadState buttons.
Hello, I would use something like this:
public List<Buttons> GetPressedButtons()
{
List<Buttons> pressedButtons = new List<Buttons>();
foreach (Buttons btn in Enum.GetValues(typeof(Buttons)))
{
if (GamePadState.Default.IsButtonDown(btn))
{
pressedButtons.Add(btn);
}
}
return pressedButtons;
}