コード例 #1
0
        public virtual IList <GamepadDevice> AvailableDevices()
        {
            IList <GamepadDevice> result = new List <GamepadDevice>();

            foreach (var deviceInstance in _directInput.GetDevices(DeviceClass.GameControl, DeviceEnumerationFlags.AttachedOnly))
            {
                GamepadDevice device = new GamepadDevice
                {
                    Guid = deviceInstance.InstanceGuid, Name = deviceInstance.InstanceName
                };

                result.Add(device);
            }

            return(result);
        }
コード例 #2
0
 public void Select(GamepadDevice device)
 {
     _currentDevice = device;
 }