private void AddWiimoteDevices() { WiimoteCollection wiiMoteCollection = new WiimoteCollection(); try { wiiMoteCollection.FindAllWiimotes(); } catch (WiimoteNotFoundException) { } catch (WiimoteException) { Console.WriteLine("Wiimote error"); } foreach (Wiimote wiimote in wiiMoteCollection) { if (!CheckIfWiimoteInputDeviceExists(wiimote)) { WiimoteInput input = new WiimoteInput(wiimote); AddInputDevice(input); input.InitCurrentlyInvokedInput(); wiimote.SetLEDs(false, false, false, false); InvokeNewInputDeviceEvent(input.DeviceInstanceId, input); } } }
public void SetFlags(bool isConnected, bool isFlying, bool isHovering, bool isEmergency) { for (int i = 0; i < inputDevices.Count; i++) { if (inputDevices[i] is WiimoteInput) { WiimoteInput wiimoteInput = (WiimoteInput)inputDevices[i]; wiimoteInput.SetLEDs(isConnected, isFlying, isHovering, isEmergency); } } }