Esempio n. 1
0
    void CheckMultiTapMouse(int index, Vector2 startPos, Vector2 lastPos)
    {
        if (multiTapMouse[index].lastTapTime > Time.realtimeSinceStartup - multiTapInterval)
        {
            if (Vector2.Distance(startPos, multiTapMouse[index].lastPos) < multiTapPosSpacing * IT_Gesture.GetDPIFactor())
            {
                multiTapMouse[index].count      += 1;
                multiTapMouse[index].lastPos     = startPos;
                multiTapMouse[index].lastTapTime = Time.realtimeSinceStartup;

                IT_Gesture.MultiTap(new Tap(startPos, lastPos, multiTapMouse[index].count, index, true));

                if (multiTapMouse[index].count >= maxMultiTapCount)
                {
                    multiTapMouse[index].count = 0;
                }
            }
            else
            {
                multiTapMouse[index].count       = 1;
                multiTapMouse[index].lastPos     = startPos;
                multiTapMouse[index].lastTapTime = Time.realtimeSinceStartup;

                IT_Gesture.MultiTap(new Tap(startPos, lastPos, 1, index, true));
            }
        }
        else
        {
            multiTapMouse[index].count       = 1;
            multiTapMouse[index].lastPos     = startPos;
            multiTapMouse[index].lastTapTime = Time.realtimeSinceStartup;

            IT_Gesture.MultiTap(new Tap(startPos, lastPos, 1, index, true));
        }
    }
Esempio n. 2
0
 private void CheckMultiTapTouch(int index, Vector2 startPos, Vector2 lastPos)
 {
     if (index >= multiTapTouch.Length)
     {
         return;
     }
     if (multiTapTouch[index].lastTapTime > Time.realtimeSinceStartup - multiTapInterval)
     {
         if (Vector2.Distance(startPos, multiTapTouch[index].lastPos) < multiTapPosSpacing * IT_Gesture.GetDPIFactor())
         {
             multiTapTouch[index].count++;
             multiTapTouch[index].lastPos     = startPos;
             multiTapTouch[index].lastTapTime = Time.realtimeSinceStartup;
             IT_Gesture.MultiTap(new Tap(startPos, lastPos, multiTapTouch[index].count, index, im: false));
             if (multiTapTouch[index].count >= maxMultiTapCount)
             {
                 multiTapTouch[index].count = 0;
             }
         }
         else
         {
             multiTapTouch[index].count       = 1;
             multiTapTouch[index].lastPos     = startPos;
             multiTapTouch[index].lastTapTime = Time.realtimeSinceStartup;
             IT_Gesture.MultiTap(new Tap(startPos, lastPos, 1, index, im: false));
         }
     }
     else
     {
         multiTapTouch[index].count       = 1;
         multiTapTouch[index].lastPos     = startPos;
         multiTapTouch[index].lastTapTime = Time.realtimeSinceStartup;
         IT_Gesture.MultiTap(new Tap(startPos, lastPos, 1, index, im: false));
     }
 }
Esempio n. 3
0
    public void CheckMultiTapMFTouch(int fCount, Vector2[] posL, int[] indexes)
    {
        Vector2 a = Vector2.zero;

        for (int i = 0; i < posL.Length; i++)
        {
            a += posL[i];
        }
        a /= posL.Length;
        int  num  = 0;
        bool flag = false;

        for (int j = 0; j < multiTapMFTouch.Length; j++)
        {
            MultiTapTracker multiTapTracker = multiTapMFTouch[j];
            if (multiTapTracker.fingerCount == fCount && Vector2.Distance(a, multiTapTracker.lastPos) < multiTapPosSpacing * IT_Gesture.GetDPIFactor())
            {
                flag = true;
                break;
            }
            num++;
        }
        if (!flag)
        {
            num = 0;
            for (int k = 0; k < multiTapMFTouch.Length; k++)
            {
                MultiTapTracker multiTapTracker2 = multiTapMFTouch[k];
                if (multiTapTracker2.lastPos == Vector2.zero && multiTapTracker2.count == 0)
                {
                    break;
                }
                num++;
            }
        }
        if (multiTapMFTouch[num].lastTapTime > Time.realtimeSinceStartup - multiTapInterval)
        {
            multiTapMFTouch[num].count++;
            multiTapMFTouch[num].lastPos     = a;
            multiTapMFTouch[num].fingerCount = fCount;
            multiTapMFTouch[num].lastTapTime = Time.realtimeSinceStartup;
            IT_Gesture.MultiTap(new Tap(multiTapMFTouch[num].count, fCount, posL, indexes));
            if (multiTapMFTouch[num].count >= maxMultiTapCount)
            {
                multiTapMFTouch[num].count = 0;
            }
        }
        else
        {
            multiTapMFTouch[num].count       = 1;
            multiTapMFTouch[num].lastPos     = a;
            multiTapMFTouch[num].fingerCount = fCount;
            multiTapMFTouch[num].lastTapTime = Time.realtimeSinceStartup;
            IT_Gesture.MultiTap(new Tap(multiTapMFTouch[num].count, fCount, posL, indexes));
        }
    }
Esempio n. 4
0
    public void CheckMultiTapMFTouch(int fCount, Vector2[] posL, int[] indexes)
    {
        Vector2 pos = Vector2.zero;

        //foreach(Vector2 p in posL){
        //	pos+=p;
        //}
        for (int i = 0; i < posL.Length; i++)
        {
            pos += posL[i];
        }
        pos /= posL.Length;

        int  index = 0;
        bool match = false;

        //foreach(MultiTapTracker multiTap in multiTapMFTouch){
        for (int i = 0; i < multiTapMFTouch.Length; i++)
        {
            MultiTapTracker multiTap = multiTapMFTouch[i];
            if (multiTap.fingerCount == fCount)
            {
                if (Vector2.Distance(pos, multiTap.lastPos) < multiTapPosSpacing * IT_Gesture.GetDPIFactor())
                {
                    match = true;
                    break;
                }
            }
            index += 1;
        }

        if (!match)
        {
            index = 0;
            //foreach(MultiTapTracker multiTap in multiTapMFTouch){
            for (int i = 0; i < multiTapMFTouch.Length; i++)
            {
                MultiTapTracker multiTap = multiTapMFTouch[i];
                if (multiTap.lastPos == Vector2.zero && multiTap.count == 0)
                {
                    break;
                }
                index += 1;
            }
        }

        if (multiTapMFTouch[index].lastTapTime > Time.realtimeSinceStartup - multiTapInterval)
        {
            multiTapMFTouch[index].count      += 1;
            multiTapMFTouch[index].lastPos     = pos;
            multiTapMFTouch[index].fingerCount = fCount;
            multiTapMFTouch[index].lastTapTime = Time.realtimeSinceStartup;

            IT_Gesture.MultiTap(new Tap(multiTapMFTouch[index].count, fCount, posL, indexes));

            if (multiTapMFTouch[index].count >= maxMultiTapCount)
            {
                multiTapMFTouch[index].count = 0;
            }
        }
        else
        {
            multiTapMFTouch[index].count       = 1;
            multiTapMFTouch[index].lastPos     = pos;
            multiTapMFTouch[index].fingerCount = fCount;
            multiTapMFTouch[index].lastTapTime = Time.realtimeSinceStartup;

            IT_Gesture.MultiTap(new Tap(multiTapMFTouch[index].count, fCount, posL, indexes));
        }
    }