Esempio n. 1
0
        IInputAction buildFingerDownUpdateAction()
        {
            IInputAction inputAction;

            if (this._activePointerStates.Count > 0)
            {
                var array = new PointerData[this._activePointerStates.Count];
                this._activePointerStates.Values.CopyTo(array: array, index: 0);
                inputAction = new MultiPointerInputAction {
                    pointerData = array
                };
            }
            else
            {
                var pointIList = new List <PointI>();
                var uintList   = new List <uint>();
                for (var iContactId = 0; iContactId < 10; ++iContactId)
                {
                    if (DynamicPressActive(iContactId: iContactId))
                    {
                        pointIList.Add(item: this.downPressLocation[iContactId]);
                        uintList.Add(item: (uint)iContactId);
                    }
                }

                inputAction = this.inputAlgorithms.DynamicMoves(point: pointIList, contactIds: uintList);
            }

            return(inputAction);
        }
Esempio n. 2
0
        void InterpolateFrame(
            IList <IInputAction> injectList,
            uint packetDelta,
            int index,
            MultiPointerInputAction multiPointerInputAction,
            MultiPointerInputAction nextPointerInputAction)
        {
            var num1 = Math.Ceiling(a: 50.0 / packetDelta);

            for (var index1 = 0; (double)index1 <= num1; ++index1)
            {
                var pointerDataList = new List <PointerData>();
                for (var index2 = 0; index2 < multiPointerInputAction.pointerData.Length; ++index2)
                {
                    if ((multiPointerInputAction.pointerData[index2].flags & POINTER_FLAGS.ContactMoves) == POINTER_FLAGS.ContactMoves || (multiPointerInputAction.pointerData[index2].flags & POINTER_FLAGS.ContactDown) == POINTER_FLAGS.ContactDown)
                    {
                        var pointerData1 = multiPointerInputAction.pointerData[index2];
                        var pointerData2 = nextPointerInputAction.pointerData[index2];
                        var num2         = pointerData2.location.X - pointerData1.location.X;
                        var num3         = pointerData2.location.Y - pointerData1.location.Y;
                        pointerData1.location.X += (int)Math.Round(a: num2 * index1 / num1);
                        pointerData1.location.Y += (int)Math.Round(a: num3 * index1 / num1);
                        pointerData1.flags       = POINTER_FLAGS.ContactMoves | POINTER_FLAGS.PRIMARY | POINTER_FLAGS.CONFIDENCE;
                        pointerDataList.Add(item: pointerData1);
                    }
                }

                injectList.Insert(index: index + index1 * 2, item: new MultiPointerInputAction {
                    pointerData = pointerDataList.ToArray()
                });
                injectList.Insert(index: index + index1 * 2 + 1, item: Input.CreateWait(duration: (int)packetDelta));
            }
        }
Esempio n. 3
0
        void MultiRelease(IList <PointI> locations, IList <IInputAction> injectList)
        {
            var pointerInputAction = new MultiPointerInputAction {
                pointerData = CreateMultiPointerInputActions(locations: locations, flag: POINTER_FLAGS.UP)
            };

            injectList.Add(item: pointerInputAction);
        }
Esempio n. 4
0
        void MultiUpdate(
            IList <PointI> locations,
            IList <IInputAction> injectList,
            IList <uint> contactIds = null)
        {
            var pointerInputAction = new MultiPointerInputAction {
                pointerData = CreateMultiPointerInputActions(locations: locations, flag: POINTER_FLAGS.ContactMoves, pointerIds: contactIds)
            };

            injectList.Add(item: pointerInputAction);
        }