Ejemplo n.º 1
0
        public HandHandler()
        {
            ClientType clientType = Properties.Settings.Default.ClientType;

            ButtonCodes.SetType(clientType);

            if (clientType == ClientType.Custom)
            {
                buttonSender = new ButtonSender(Properties.Settings.Default.ClientType);
            }
            else
            {
                if (clientType == ClientType.XBMC)
                {
                    buttonSender = new ButtonSender(Properties.Settings.Default.ClientType, Properties.Settings.Default.IpAddress, 9777);
                }
                else if (clientType == ClientType.Boxee)
                {
                    buttonSender = new ButtonSender(Properties.Settings.Default.ClientType, Properties.Settings.Default.IpAddress, 9770);
                }
                buttonSender.SendNotification("KinEmote v0.3", "Hand Detected, tracking started.");
            }

            lastDirection = Direction.Illegal;
            handMode      = HandMode.Normal;
            lastPoint     = new Point(1, 2);

            intervalTimer          = new Timer();
            intervalTimer.Elapsed += new ElapsedEventHandler(intervalTimer_Elapsed);
        }
Ejemplo n.º 2
0
        public HandHandler()
        {
            ClientType clientType = Properties.Settings.Default.ClientType;
            ButtonCodes.SetType(clientType);

            if (clientType == ClientType.Custom)
            {
                buttonSender = new ButtonSender(Properties.Settings.Default.ClientType);
            }
            else
            {
                if (clientType == ClientType.XBMC)
                {
                    buttonSender = new ButtonSender(Properties.Settings.Default.ClientType, Properties.Settings.Default.IpAddress, 9777);
                }
                else if (clientType == ClientType.Boxee)
                {
                    buttonSender = new ButtonSender(Properties.Settings.Default.ClientType, Properties.Settings.Default.IpAddress, 9770);
                }
                buttonSender.SendNotification("KinEmote v0.3", "Hand Detected, tracking started.");
            }

            lastDirection = Direction.Illegal;
            handMode = HandMode.Normal;
            lastPoint = new Point(1, 2);

            intervalTimer = new Timer();
            intervalTimer.Elapsed += new ElapsedEventHandler(intervalTimer_Elapsed);
        }
Ejemplo n.º 3
0
        public void SetMode(HandMode g_newMode)
        {
            myMode = g_newMode;
            Sprite t_sprite = null;

            switch (g_newMode)
            {
            case HandMode.Copy:
                t_sprite = CS_VR_Settings.Instance.myHandModeSprite_Copy;
                break;

            case HandMode.Delete:
                t_sprite = CS_VR_Settings.Instance.myHandModeSprite_Delete;
                break;
            }
            myModeDisplay.ChangeSprite(t_sprite);
        }
Ejemplo n.º 4
0
 public void HandlePush(Direction pushDirection)
 {
     if (handMode == HandMode.Normal)
     {
         if (pushDirection == Direction.Forward)
         {
             buttonSender.SendKey(ButtonCodes.MidPush);
         }
         else
         {
             intervalTimer.Stop();
             buttonSender.SendNotification("KinEmote v0.3", "Hand moved to back plane.");
             handMode = HandMode.BackPlane;
         }
     }
     else
     {
         handMode = HandMode.Normal;
         buttonSender.SendNotification("KinEmote v0.3", "Hand moved to mid plane.");
     }
 }
Ejemplo n.º 5
0
 public void HandlePush(Direction pushDirection)
 {
     if (handMode == HandMode.Normal)
     {
         if (pushDirection == Direction.Forward)
         {
             buttonSender.SendKey(ButtonCodes.MidPush);
         }
         else
         {
             intervalTimer.Stop();
             buttonSender.SendNotification("KinEmote v0.3", "Hand moved to back plane.");
             handMode = HandMode.BackPlane;
         }
     }
     else
     {
         handMode = HandMode.Normal;
         buttonSender.SendNotification("KinEmote v0.3", "Hand moved to mid plane.");
     }
 }
Ejemplo n.º 6
0
 public HandInfo(GameObject g_prefab, Hand g_hand)
 {
     myHand        = g_hand;
     myMode        = HandMode.Edit;
     myModeDisplay = Instantiate(g_prefab).GetComponent <CS_VR_HandModeDisplay> ();
 }
Ejemplo n.º 7
0
 public void OnButtonHandMode(Hand g_hand, HandMode g_mode)
 {
     myHandModeDictionary [g_hand].SetMode(g_mode);
 }