Пример #1
0
        public TouchButton(float x, float y, float w, float h, BasicMultiFingerGRConfiguration configuration)
        {
            m_x = x;
            m_y = y;
            m_width = w;
            m_height = h;

            GestureEventManager.RegisterHandler(typeof(BasicMultiFingerGR), configuration, "Down", OnGestureEvent);
            GestureEventManager.RegisterHandler(typeof(BasicMultiFingerGR), configuration, "Up", OnGestureEvent);
            GestureEventManager.RegisterHandler(typeof(BasicMultiFingerGR), configuration, "Move", OnGestureEvent);
            GestureEventManager.RegisterHandler(typeof(BasicMultiFingerGR), configuration, "Enter", OnGestureEvent);
            GestureEventManager.RegisterHandler(typeof(BasicMultiFingerGR), configuration, "Leave", OnGestureEvent);
            GestureEventManager.RegisterHandler(typeof(BasicMultiFingerGR), configuration, "Tap", OnGestureEvent);
            GestureEventManager.RegisterHandler(typeof(BasicMultiFingerGR), configuration, "DoubleTap", OnGestureEvent);
            GestureEventManager.RegisterHandler(typeof(BasicMultiFingerGR), configuration, "TripleTap", OnGestureEvent);
            GestureEventManager.RegisterHandler(typeof(BasicMultiFingerGR), configuration, "Hover", OnGestureEvent);
            GestureEventManager.RegisterHandler(typeof(BasicMultiFingerGR), configuration, "EndHover", OnGestureEvent);
        }
Пример #2
0
        public BasicMultiFingerGR(GRConfiguration configuration)
            : base(configuration)
        {
            if (!(configuration is BasicMultiFingerGRConfiguration))
                Configuration = new BasicMultiFingerGRConfiguration();

            BasicMultiFingerGRConfiguration conf = (BasicMultiFingerGRConfiguration)Configuration;
            TAP_TIME = conf.TAP_TIME;
            HOVER_SIZE = conf.HOVER_SIZE;
            HOVER_TIME = conf.HOVER_TIME;
            IS_TRIPLE_TAP_ENABLED = conf.IS_TRIPLE_TAP_ENABLED;

            ClosestCurrentEvents = new string[] { "Down", "Up", "Tap", "DoubleTap", "TripleTap", "Hover", "EndHover", "Move" }; // add, remove?
            ClosestEnteringEvents = new string[] { "Enter" };
            ClosestLeavingEvents = new string[] { "Leave" };
            UnionEvents = new string[] { "Removed", "Terminated" };

            m_hoverThread = new Thread(new ThreadStart(HoverLoop));
            m_hoverThread.Start();
            m_tapSpatialConstraintsOk = true;
            m_numberOfCurrentFingers = 0;
            m_tapNumberOfFingers = 0;
        }