Exemplo n.º 1
0
        void mipTap(Vector2 position)
        {
            if ((System.DateTime.Now - timeLastReset).TotalMilliseconds < FingerUpTimeOut)
            {
                return;
            }

            MoverioTouchpadEventArgs args = new MoverioTouchpadEventArgs(MoverioTouchpadEventType.Tap);

            args.Position = position;
            args.Origin   = position;
            args.Last     = position;
            MessageBroker.BroadcastAll("OnTap", args);

            System.DateTime tapTime = System.DateTime.Now;
            if ((tapTime - lastTapTime).TotalMilliseconds < TapTimeOut)
            {
                args          = new MoverioTouchpadEventArgs(MoverioTouchpadEventType.DoubleTap);
                args.Position = position;
                args.Origin   = position;
                args.Last     = position;
                MessageBroker.BroadcastAll("OnDoubleTap", args);
            }
            lastTapTime = tapTime;
        }
Exemplo n.º 2
0
        void mipTouchMoved(Vector2 position, Vector2 origin, Vector2 last)
        {
            MoverioTouchpadEventArgs args = new MoverioTouchpadEventArgs(MoverioTouchpadEventType.TouchMoved);

            args.Position = position;
            args.Origin   = origin;
            args.Last     = last;

            MessageBroker.BroadcastAll("OnTouchMoved", args);
        }
Exemplo n.º 3
0
        void mipTouchStarted(Vector2 position)
        {
            if (!touchStarted)
            {
                touchStarted = true;
                if ((System.DateTime.Now - timeLastReset).TotalMilliseconds < FingerUpTimeOut)
                {
                    return;
                }

                MoverioTouchpadEventArgs args = new MoverioTouchpadEventArgs(MoverioTouchpadEventType.TouchStarted);
                args.Position = position;
                args.Origin   = position;
                args.Last     = position;

                MessageBroker.BroadcastAll("OnTouchStarted", args);
            }
        }
Exemplo n.º 4
0
        void mipTouchEnded(Vector2 position, Vector2 origin, System.TimeSpan lenght)
        {
            if (touchStarted)
            {
                touchStarted = false;
                if ((System.DateTime.Now - timeLastReset).TotalMilliseconds < FingerUpTimeOut)
                {
                    return;
                }

                MoverioTouchpadEventArgs args = new MoverioTouchpadEventArgs(MoverioTouchpadEventType.TouchEnded);
                args.Position = position;
                args.Origin   = origin;
                args.Duration = lenght;

                MessageBroker.BroadcastAll("OnTouchEnded", args);

                if (isAndroid && resetMousePointerOnTouchEnded)
                {
                    if (!isJNIInitialized)
                    {
                        CommToAndroid.CallAndroidMethod("setDisplaySize", Screen.width, Screen.height);
                        CommToAndroid.CallAndroidMethod("openMouseCursor", "UnityMoverioBT200");

                        isJNIInitialized = true;
                    }
                    else
                    {
                        CommToAndroid.CallAndroidMethod("mouseMove", -1, -1);
                        CommToAndroid.CallAndroidMethod("mouseMove", 180, 100);
                    }

                    touchOrigin       = Input.mousePosition;
                    touchLastPosition = Input.mousePosition;
                    timeLastReset     = System.DateTime.Now;
                }
            }
        }
Exemplo n.º 5
0
 void OnDoubleTap(MoverioTouchpadEventArgs args)
 {
     SetBaselineRotation();
 }