/// <inheritdoc/> public override IEnumerable <IInputDevice> GetConnectedDevices() { var guid = new Guid("0306057e-0000-0000-0000-504944564944"); return(from device in this.inputManager.GetAllDevices() where device?.DI_ProductGUID == guid let wiimoteHandle = WiimoteEnumerator.CreateFile(device.DI_InterfacePath) let deviceId = "DEVICE_WII_REMOTE" where WiimoteEnumerator.IsWiimoteConnected(wiimoteHandle) select new InputDevice(InputApi.Other, device, this.ControllerLayout)); }
public static SafeHandle CreateFile(string devicePath) { return(WiimoteEnumerator.CreateFile(devicePath, FileAccess.ReadWrite, FileShare.ReadWrite, IntPtr.Zero, FileMode.Open, 0x40000000, IntPtr.Zero)); }