public IEnumerable <uint> GetControllers() { var result = new List <uint>(); for (uint i = 0; i < MaxScannedPlayer; i++) { var cab = new XInputCapabilities(); var avail = XInputInvoker.XInputGetCapabilities(i, XInputGetCapabilitiesFlag.XINPUT_FLAG_GAMEPAD, ref cab); if (avail == XInputOpResult.Success) { result.Add(i); } } return(result); }
public static extern XInputOpResult XInputGetCapabilities(uint dwUserIndex, XInputGetCapabilitiesFlag dwFlags, ref XInputCapabilities pCapabilities);