示例#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);
        }
示例#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);
        }
示例#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);
        }
示例#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.");
     }
 }
示例#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.");
     }
 }
示例#6
0
 public HandInfo(GameObject g_prefab, Hand g_hand)
 {
     myHand        = g_hand;
     myMode        = HandMode.Edit;
     myModeDisplay = Instantiate(g_prefab).GetComponent <CS_VR_HandModeDisplay> ();
 }
示例#7
0
 public void OnButtonHandMode(Hand g_hand, HandMode g_mode)
 {
     myHandModeDictionary [g_hand].SetMode(g_mode);
 }