Beispiel #1
0
 private void Myo_GyroscopeDataAcquired(object sender, GyroscopeDataEventArgs e)
 {
     this._mouse.onGyroscope(e.Gyroscope);
     if (!e.Myo.IsUnlocked)
     {
         return;
     }
     MyoController.mouse_event(1, (int)this._mouse.dx, (int)this._mouse.dy, 0, 0);
 }
Beispiel #2
0
 private void Myo_PoseChanged(object sender, PoseEventArgs e)
 {
     RhinoApp.WriteLine("Pose Changed: {0}", (object)e.Pose.ToString());
     if (e.Pose == Pose.DoubleTap)
     {
         e.Myo.Lock();
     }
     if (e.Pose == Pose.Fist)
     {
         MyoController.mouse_event(2, Cursor.Position.X, Cursor.Position.Y, 0, 0);
         MyoController.mouse_event(4, Cursor.Position.X, Cursor.Position.Y, 0, 0);
     }
     if (e.Pose == Pose.FingersSpread)
     {
         this._fingerSpreadDone             = true;
         this._toolBoxConduit.Enabled       = (true);
         this._toolBoxConduit.PopUpPosLeft  = RiftViewportConduit.CursorInLeftViewport;
         this._toolBoxConduit.PopUpPosRight = RiftViewportConduit.CursorInRightViewport;
     }
     if (e.Pose == Pose.FingersSpread || !this._fingerSpreadDone)
     {
         return;
     }
     this._fingerSpreadDone       = false;
     this._toolBoxConduit.Enabled = (false);
     if (!this._toolBoxConduit.ExecuteCommand())
     {
         MyoController.mouse_event(8, Cursor.Position.X, Cursor.Position.Y, 0, 0);
         MyoController.mouse_event(16, Cursor.Position.X, Cursor.Position.Y, 0, 0);
     }
     if (!UserInput.MiniViewportsOn)
     {
         return;
     }
     for (int index = 0; index < 3; ++index)
     {
         if (Viewports.MiniViews[index] != null && Viewports.MiniViews[index].Document != null)
         {
             Viewports.MiniViews[index].Redraw();
         }
     }
 }