private void start(object sender, RoutedEventArgs e) { if (startbutton.Content.Equals("スタート")) { time_t = timese; target = 0; countdown.Foreground = System.Windows.Media.Brushes.Red; countdown.Content = "3"; cdtime = 0; cnttime = 0; count.Content = "獲得点数 0点"; wiimote.Connect(); dispatcharTimer11.Start(); } else if (startbutton.Content.Equals("リスタート")) { countdown.Foreground = System.Windows.Media.Brushes.Red; countdown.Content = "3"; cdtime = 0; wiimote.Connect(); dispatcharTimer11.Start(); } else { //ストップの状態だと wiimote.Disconnect(); startbutton.Content = "リスタート"; game = false; dispatcharTimer.Stop(); } }
void Page_Closing(object sender, System.ComponentModel.CancelEventArgs e) //アプリ閉じたら { //if (game == true) //{ wiimote.Disconnect(); //} }
void bout(object sender, EventArgs e) { wiimote.Disconnect(); var nextPage = new MainTitle(); NavigationService.Navigate(nextPage); }
public void StopDesktop() { if (IsCalibrated() && (lastCalibrationData != null)) { CalibrationPersister.SaveCalibrationData(lastCalibrationData); } wiimote.SetReportType(Wiimote.InputReport.IRAccel, false); wiimote.SetLEDs(false, false, false, false); wiimote.Disconnect(); }
private void Form1_FormClosing(object sender, FormClosingEventArgs e) { if (wm1.WiimoteState.ConnectionState == WiimoteLib.ConnectionState.Connected) { wm1.Disconnect(); } if (wm2.WiimoteState.ConnectionState == WiimoteLib.ConnectionState.Connected) { wm2.Disconnect(); } }
void bac(object sender, EventArgs e) { var nextPage = new k_Top(); NavigationService.Navigate(nextPage); if (train == true) { wiimote.Disconnect(); wiimo = false; timer.Stop(); } }
private void teardownWiimoteConnection(Wiimote pDevice) { if (pDevice != null) { pDeviceMutex.WaitOne(); pDevice.WiimoteChanged -= this.wiimoteChangedEventHandler; pDevice.WiimoteExtensionChanged -= this.wiimoteExtensionChangedEventHandler; int wiimoteid; if (pWiimoteMap.Keys.Contains(pDevice.HIDDevicePath)) { wiimoteid = this.pWiimoteMap[pDevice.HIDDevicePath].Status.ID; this.pWiimoteMap[pDevice.HIDDevicePath].Teardown(); this.pWiimoteMap.Remove(pDevice.HIDDevicePath); } else { wiimoteid = this.pWiimoteMap.Count + 1; } pDeviceMutex.ReleaseMutex(); pDevice.SetReportType(InputReport.Status, false); pDevice.SetRumble(false); pDevice.SetLEDs(true, true, true, true); // Close the connection and dispose of the device. pDevice.Disconnect(); pDevice.Dispose(); OnDisconnect(wiimoteid, this.pWiimoteMap.Count); } }
private void Form1_FormClosed(object sender, FormClosedEventArgs e) { mWiimote.SetLEDs(false, false, false, false); mWiimote.Disconnect(); DX.DxLib_End(); }
private void FormMain_FormClosing(object sender, FormClosingEventArgs e) { // Stop updates. infoUpdateTimer.Enabled = false; wiiDevice.Disconnect(); }
private void disconnectButton_Click(object sender, EventArgs e) { wiiDevice.SetLEDs(false, false, false, false); wiiDevice.Disconnect(); softLabel.Text = "Board disconnected."; }
private void Cancel() { infoUpdateTimer.Enabled = false; wiiDevice.Disconnect(); _canConnectWBB = true; _app.CurrentPageViewModel = _app.PreviousPageViewModel; }
/// <summary> /// Unloads our plugin /// </summary> public override void Unload() { if (remote != null) { remote.Disconnect(); } ParentApplication.WorldWindow.KeyUp -= m_keyHandler; }
/// <summary> /// Unloads our plugin /// </summary> public override void Unload() { if (remote != null) { remote.Disconnect(); } Global.worldWindow.KeyUp -= m_keyHandler; }
internal static void Disconnect() { if (Wiimote != null) { Wiimote.SetLEDs(false, false, false, false); Wiimote.Disconnect(); Wiimote = null; } }
/// <summary> /// Stop the IR Server plugin. /// </summary> public override void Stop() { if (_wiimote == null) { return; } _wiimote.SetLEDs(false, false, false, false); _wiimote.SetRumble(false); _wiimote.Disconnect(); }
private void start(object sender, RoutedEventArgs e) { if (startbutton.Content.Equals("スタート")) { time_t = timekeeper; cnttime = 0; // target = 0; countdown.Foreground = System.Windows.Media.Brushes.Red; countdown.Content = "3"; GameOver_flg = false; cdtime = 0; //鬼のオブジェクト・座標を初期化 ye = 0; xe = 0; this.field.Children.Remove(this.Enemy); //重心のオブジェクト・座標を初期化 xza = 0; yza = 0; this.field.Children.Remove(this.drawingBalance); wiimote.Connect(); dispatcharTimer11.Start(); } else if (startbutton.Content.Equals("リスタート")) //リスタートの状態だと { countdown.Foreground = System.Windows.Media.Brushes.Red; countdown.Content = "3"; cdtime = 0; wiimote.Connect(); dispatcharTimer11.Start(); } else { //ストップの状態だと wiimote.Disconnect(); startbutton.Content = "リスタート"; game = false; dispatcharTimer.Stop(); } }
private void Disconnect_Click(object sender, EventArgs e) { wiiDevice.Disconnect(); Connect.Enabled = true; Start30.Enabled = false; Start60.Enabled = false; Disconnect.Enabled = false; StatusDat.Text = "Not Connected"; StatusDat.Refresh(); StatusContainer.Update(); }
public override void Unload() { try { _wiimote.SetLEDs(false, false, false, false); _wiimote.Disconnect(); } catch (Exception exc) { Logger.Instance.Error(exc.Message, exc); } _wiimote = null; }
//----------------------------------------------------------------------- public override void Stop() { if (Motes != null) { for (int i = 0; i < Motes.Count; i++) { Wiimote wii = Motes.ElementAt(i); wii.SetLEDs(false, false, false, false); wii.Disconnect(); } Motes = null; } }
public void OnClosing() { if (wm != null) { try { wm.Disconnect(); } catch { } } }
void MainWindowClosed(object sender, EventArgs e) { try { if (wm != null) { wm.Disconnect(); } } catch (Exception ex) { Trace.WriteLine(ex); } }
private void Form1_FormClosed(object sender, FormClosedEventArgs e) { // 閉じられたら this.Text = "Wiimote Mouse - Closing..."; this.notifyIcon1.Text = "Wiimote Mouse - Closing..."; mWiimote.SetLEDs(false, false, false, false); mWiimote.Disconnect(); System.Threading.Thread.Sleep(3000); Application.DoEvents(); btu = new BTUtil(); btu.disconnectWiimote(); Application.DoEvents(); }
private void frmMain_FormClosing(object sender, FormClosingEventArgs e) { /****************************************************************** * PreCondition: The form is closing * PostCondition: If a Wii Remote is connected, it will be disconnected * Description: This event terminates any communication with the * Wii Remote * Algorithm: If a Wii Remote is connected, * Turn off the Player 1 LED * Disconnect the Wii Remote *****************************************************************/ //If there's a Wii Remote connected, disconnect from it if (WiiRemotePresent) { Remote.SetLEDs(false, false, false, false); //Turn off the LEDs Remote.Disconnect(); } }
private void FormMain_FormClosing(object sender, FormClosingEventArgs e) { // Stop updates. infoUpdateTimer.Enabled = false; wiiDevice.Disconnect(); // Prevent 'stuck' down keys from closing while doing an action. actionList.Left.Stop(); actionList.Right.Stop(); actionList.Forward.Stop(); actionList.Backward.Stop(); actionList.Modifier.Stop(); actionList.Jump.Stop(); actionList.DiagonalLeft.Stop(); actionList.DiagonalRight.Stop(); }
/// <summary> /// Dispose and destroy the Wiimote manager /// </summary> public void Dispose() { if (_wiimote != null) { try { _wiimote.WiimoteChanged -= wiimote_WiimoteChanged; _wiimote.WiimoteExtensionChanged -= wiimote_WiimoteExtensionChanged; _wiimote.Disconnect(); _wiimote.Dispose(); _wiimote = null; } catch (Exception ex) { Console.Error.WriteLine(ex.Message); IsAvailable = false; } } }
private void AddNewWiimote(Wiimote NewWiimote) { if (AvailableIndices.Count == 0) { NewWiimote.Disconnect(); } NewWiimote.WiimoteDisconnected += OnWiimoteDisconnected; NewWiimote.ButtonPressed += OnButtonPressed; int WiimoteIndex = AvailableIndices[0]; AvailableIndices.RemoveAt(0); Wiimote.WiimoteLED LED = Wiimote.WiimoteLED.ALL; switch (WiimoteIndex) { case 0: LED = Wiimote.WiimoteLED.LED1; break; case 1: LED = Wiimote.WiimoteLED.LED2; break; case 2: LED = Wiimote.WiimoteLED.LED3; break; case 3: LED = Wiimote.WiimoteLED.LED4; break; } NewWiimote.SetLED(LED); RumbleWiimote(NewWiimote); Buzzer.Add(new Buzzer("Team " + (WiimoteIndex + 1), BuzzerColors[WiimoteIndex], WiimoteIndex, NewWiimote)); Buzzer.Sort(); BuzzerPanel.Items.Refresh(); }
//接続・切断ボタンが押されたら private void button1_Click_1(object sender, EventArgs e) { if (button1.Text.Equals("CONNECT")) { wm.Connect(); //Wiimoteの接続 wm.WiimoteChanged += wm_WiimoteChanged; //イベント関数の登録 wm.SetReportType(InputReport.IRExtensionAccel, true); //レポートタイプの設定 wm.InitializeMotionPlus(); button1.Text = "DISCONNECT"; label1.Text = "GYRO DISABLED"; wm.SetLEDs(1); } else { wm.SetLEDs(0); wm.Disconnect(); //Wiimote切断 button1.Text = "CONNECT"; label1.Text = ""; } }
private void Form1_FormClosing(object sender, FormClosingEventArgs e) { wm.Disconnect(); }
public void DisconnectWiimote() { wm.Disconnect(); wm.SetReportType(InputReport.IRAccel, true); wm.SetLEDs(false, true, true, false); }
private void Form1_FormClosed(object sender, FormClosedEventArgs e) { //disconnect the wiimote wm.Disconnect(); saveCalibrationData(); }