Example #1
0
        public void OnKeyPressed(KeyEventArgs keys)
        {
            var key = keys.KeyCode;

            if (key == ExplodeOut)
            {
                _currentAppState.OnGesture(GestureType.ExplodeOut);
            }
            if (key == ExplodeIn)
            {
                _currentAppState.OnGesture(GestureType.ExplodeIn);
            }

            if (JointsByKeySelector.ContainsKey(key))
            {
                UpdateCurrentJoint(key);
            }

            if (MovementVectorsByKey.ContainsKey(key))
            {
                PerformMovement(key);
            }

            UpdateListeners();
        }
        public KeyboardSkeletonUpdater()
        {
            _gestureIndex = -1;

            _gestureRecognizer            = new GestureRecognizer();
            _gestureRecognizer.OnGesture += (sender, args) =>
            {
                if (_currentAppState != null)
                {
                    _currentAppState.OnGesture(args.GestureType);
                }
            };

            _currentJoints = new List <JointType>()
            {
                JointType.HandLeft
            };
            _currentSkeleton = new KeyboardSkeletonFactory().CreateInitialSkeleton();
        }