/// <summary> /// Gets the devices for a particular <see cref="DeviceType"/> and <see cref="DeviceEnumerationFlags"/>. /// </summary> /// <param name="deviceType">Type of the device.</param> /// <param name="deviceEnumFlags">The device enum flags.</param> /// <returns>A collection of <see cref="DeviceInstance"/></returns> public IList <DeviceInstance> GetDevices(DeviceType deviceType, DeviceEnumerationFlags deviceEnumFlags) { var enumDevicesCallback = new EnumDevicesCallback(); EnumDevices((int)deviceType, enumDevicesCallback.NativePointer, IntPtr.Zero, deviceEnumFlags); return(enumDevicesCallback.DeviceInstances); }
public void PrintInputDevices(DeviceEnumerationFlags inputDeviceStatus) { IList <DeviceInstance> attachedInputDevices = this.m_DirectInput.GetDevices(DeviceClass.GameController, inputDeviceStatus); if (!attachedInputDevices.Any()) { Console.WriteLine("No Game Controllers were found"); return; } foreach (DeviceInstance device in attachedInputDevices) { Console.WriteLine("Game Controller Product Name: " + device.ProductName); } }
public IList <DeviceInstance> GetDevices(DeviceClass deviceClass, DeviceEnumerationFlags flags) { return(_directInput.GetDevices(deviceClass, flags)); }
/// <summary> /// Gets the devices for a particular <see cref="DeviceType"/> and <see cref="DeviceEnumerationFlags"/>. /// </summary> /// <param name="deviceType">Type of the device.</param> /// <param name="deviceEnumFlags">The device enum flags.</param> /// <returns>A collection of <see cref="DeviceInstance"/></returns> public IList<DeviceInstance> GetDevices(DeviceType deviceType, DeviceEnumerationFlags deviceEnumFlags) { var enumDevicesCallback = new EnumDevicesCallback(); EnumDevices((int)deviceType, enumDevicesCallback.NativePointer, IntPtr.Zero, deviceEnumFlags); return enumDevicesCallback.DeviceInstances; }