Пример #1
0
        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);
        }
Пример #2
0
 public static extern XInputOpResult XInputGetCapabilities(uint dwUserIndex, XInputGetCapabilitiesFlag dwFlags, ref XInputCapabilities pCapabilities);