示例#1
0
        public void OnTouchesEnded(NSSet touches, UIEvent evt)
        {
            mMouseDown = false;

            foreach (UITouch touch in touches)
            {
                var p = GetPosition(touch);

                //Console.WriteLine ("touches-ended {0}", p);

                var te = new flash.events.TouchEvent(flash.events.TouchEvent.TOUCH_END, true, false, 0, true, p.X, p.Y, 1.0, 1.0, 1.0);
                mStage.dispatchEvent(te);

                // Mouse events can be deactivated if a gesture was recognized
                if (mDeactivateMouseEvents == false)
                {
                    mStage.mouseX = p.X;
                    mStage.mouseY = p.Y;
                    // Mouse up events can be deactivated is a gesture was recognized before and we had to already send a mouse up
                    // to avoid having the mouse up at the end of gesture (with the full delta range between the two)
                    if (mSkipNextMouseUp == false)
                    {
                        var me = new flash.events.MouseEvent(flash.events.MouseEvent.MOUSE_UP, true, false, p.X, p.Y, mStage);
                        mStage.dispatchEvent(me);
                    }
                }
            }

            if (mDeactivateMouseEvents == false)
            {
                mSkipNextMouseUp = false;
            }
        }
示例#2
0
        private List <flash.events.TouchEvent> CreateTouchEvents(String action, MotionEvent e)
        {
            flash.events.TouchEvent        touchEvent  = new flash.events.TouchEvent(action, true, false, 0, true, e.GetX(), e.GetY(), 1.0, 1.0, 1.0);
            List <flash.events.TouchEvent> touchEvents = new List <flash.events.TouchEvent> ();

            touchEvents.Add(touchEvent);
            return(touchEvents);
        }
示例#3
0
        public void OnMouseMoved(PointF p, uint buttonMask)
        {
            mStage.mouseX = p.X;
            mStage.mouseY = p.Y;

            // dispatch touch event
            var te = new flash.events.TouchEvent(flash.events.TouchEvent.TOUCH_MOVE, true, false, 0, true, p.X, p.Y, 1.0, 1.0, 1.0);

            mStage.dispatchEvent(te);

            // dispatch mouse event
            var me = new flash.events.MouseEvent(flash.events.MouseEvent.MOUSE_MOVE, true, false, p.X, p.Y, mStage);

            mStage.dispatchEvent(me);
        }
示例#4
0
        public void OnTouchesEnded(NSSet touches, UIEvent evt)
        {
            foreach (UITouch touch in touches)
            {
                var p = touch.LocationInView(touch.View);
                //Console.WriteLine ("touches-ended {0}", p);

                mStage.mouseX = p.X;
                mStage.mouseY = p.Y;

                var te = new flash.events.TouchEvent(flash.events.TouchEvent.TOUCH_END, true, false, 0, true, p.X, p.Y, 1.0, 1.0, 1.0);
                mStage.dispatchEvent(te);

                var me = new flash.events.MouseEvent(flash.events.MouseEvent.MOUSE_UP, true, false, p.X, p.Y, mStage);
                mStage.dispatchEvent(me);
            }
        }
示例#5
0
        public void OnMouseUp(PointF p, uint buttonMask)
        {
            mStage.mouseX = p.X;
            mStage.mouseY = p.Y;

            // dispatch touch event
            mSpanPlayerTouch.Begin();
            var te = new flash.events.TouchEvent(flash.events.TouchEvent.TOUCH_END, true, false, 0, true, p.X, p.Y, 1.0, 1.0, 1.0);

            mStage.dispatchEvent(te);
            mSpanPlayerTouch.End();

            // dispatch mouse event
            mSpanPlayerMouseUp.Begin();
            var me = new flash.events.MouseEvent(flash.events.MouseEvent.MOUSE_UP, true, false, p.X, p.Y, mStage);

            mStage.dispatchEvent(me);
            mSpanPlayerMouseUp.End();
        }
示例#6
0
        public void OnTouchesMoved(NSSet touches, UIEvent evt)
        {
            foreach (UITouch touch in touches)
            {
                var p = GetPosition(touch);
                //Console.WriteLine ("touches-moved {0}", p);

                var te = new flash.events.TouchEvent(flash.events.TouchEvent.TOUCH_MOVE, true, false, 0, true, p.X, p.Y, 1.0, 1.0, 1.0);
                mStage.dispatchEvent(te);

                // Mouse events can be deactivated if a gesture was recognized
                if (mDeactivateMouseEvents == false)
                {
                    mStage.mouseX = p.X;
                    mStage.mouseY = p.Y;
                    var me = new flash.events.MouseEvent(flash.events.MouseEvent.MOUSE_MOVE, true, false, p.X, p.Y, mStage);
                    mStage.dispatchEvent(me);
                }
            }
        }
示例#7
0
        // TODO: at some point we'll have a platform agnostic notion of touches to pass to the player, for now we use UITouch
        public void OnTouchesBegan(NSSet touches, UIEvent evt)
        {
            mMouseDown = true;                          // This is used so we can send a MOUSE_UP event

            foreach (UITouch touch in touches)
            {
                var p = GetPosition(touch);
                //Console.WriteLine ("touches-began {0}", p);

                var te = new flash.events.TouchEvent(flash.events.TouchEvent.TOUCH_BEGIN, true, false, 0, true, p.X, p.Y, 1.0, 1.0, 1.0);
                mStage.dispatchEvent(te);

                // Mouse events can be deactivated if a gesture was recognized
                if (mDeactivateMouseEvents == false)
                {
                    mStage.mouseX = p.X;
                    mStage.mouseY = p.Y;
                    var me = new flash.events.MouseEvent(flash.events.MouseEvent.MOUSE_DOWN, true, false, p.X, p.Y, mStage);
                    mStage.dispatchEvent(me);
                }
            }
        }
示例#8
0
        public void OnMouseUp(PointF p, uint buttonMask)
        {
            mStage.mouseX = p.X;
            mStage.mouseY = p.Y;

            // dispatch touch event
            var te = new flash.events.TouchEvent(flash.events.TouchEvent.TOUCH_END, true, false, 0, true, p.X, p.Y, 1.0, 1.0, 1.0 );
            mStage.dispatchEvent (te);

            // dispatch mouse event
            var me = new flash.events.MouseEvent(flash.events.MouseEvent.MOUSE_UP, true, false, p.X, p.Y, mStage);
            mStage.dispatchEvent (me);
        }
示例#9
0
 private List<flash.events.TouchEvent> CreateTouchEvents(String action, MotionEvent e)
 {
     flash.events.TouchEvent touchEvent = new flash.events.TouchEvent(action, true, false, 0, true, e.GetX(), e.GetY(), 1.0, 1.0, 1.0 );
     List<flash.events.TouchEvent> touchEvents = new List<flash.events.TouchEvent> ();
     touchEvents.Add (touchEvent);
     return touchEvents;
 }
示例#10
0
		public void OnMouseMoved(PointF p, uint buttonMask)
		{
			mStage.mouseX = p.X;
			mStage.mouseY = p.Y;
			
			// dispatch touch event
			mSpanPlayerTouch.Begin();
			var te = new flash.events.TouchEvent(flash.events.TouchEvent.TOUCH_MOVE, true, false, 0, true, p.X, p.Y, 1.0, 1.0, 1.0 );
			mStage.dispatchEvent (te);
			mSpanPlayerTouch.End();

			// dispatch mouse event
			mSpanPlayerMouseMove.Begin();
			var me = new flash.events.MouseEvent(flash.events.MouseEvent.MOUSE_MOVE, true, false, p.X, p.Y, mStage);
			mStage.dispatchEvent (me);
			mSpanPlayerMouseMove.End();
		}
示例#11
0
		public void OnTouchesEnded (NSSet touches, UIEvent evt)
		{
			mMouseDown = false;

			foreach (UITouch touch in touches) {
				var p = GetPosition(touch);

				//Console.WriteLine ("touches-ended {0}", p);

				var te = new flash.events.TouchEvent(flash.events.TouchEvent.TOUCH_END, true, false, 0, true, p.X, p.Y, 1.0, 1.0, 1.0 );
				mStage.dispatchEvent (te);

				// Mouse events can be deactivated if a gesture was recognized
				if (mDeactivateMouseEvents == false) {
					mStage.mouseX = p.X;
					mStage.mouseY = p.Y;
					// Mouse up events can be deactivated is a gesture was recognized before and we had to already send a mouse up
					// to avoid having the mouse up at the end of gesture (with the full delta range between the two)
					if (mSkipNextMouseUp == false) {
						var me = new flash.events.MouseEvent(flash.events.MouseEvent.MOUSE_UP, true, false, p.X, p.Y, mStage);
						mStage.dispatchEvent (me);
					}
				}
			}

			if (mDeactivateMouseEvents == false) {
				mSkipNextMouseUp = false;
			}
		}
示例#12
0
		public void OnTouchesMoved (NSSet touches, UIEvent evt)
		{
			foreach (UITouch touch in touches) {
				var p = GetPosition(touch);
				//Console.WriteLine ("touches-moved {0}", p);

				var te = new flash.events.TouchEvent(flash.events.TouchEvent.TOUCH_MOVE, true, false, 0, true, p.X, p.Y, 1.0, 1.0, 1.0 );
				mStage.dispatchEvent (te);

				// Mouse events can be deactivated if a gesture was recognized
				if (mDeactivateMouseEvents == false) {
					mStage.mouseX = p.X;
					mStage.mouseY = p.Y;
					var me = new flash.events.MouseEvent(flash.events.MouseEvent.MOUSE_MOVE, true, false, p.X, p.Y, mStage);
					mStage.dispatchEvent (me);
				}
			}
		}
示例#13
0
		// TODO: at some point we'll have a platform agnostic notion of touches to pass to the player, for now we use UITouch
		public void OnTouchesBegan (NSSet touches, UIEvent evt)
		{
			mMouseDown = true;		// This is used so we can send a MOUSE_UP event 

			foreach (UITouch touch in touches) {
				var p = GetPosition(touch);
				//Console.WriteLine ("touches-began {0}", p);

				var te = new flash.events.TouchEvent(flash.events.TouchEvent.TOUCH_BEGIN, true, false, 0, true, p.X, p.Y, 1.0, 1.0, 1.0 );
				mStage.dispatchEvent (te);

				// Mouse events can be deactivated if a gesture was recognized
				if (mDeactivateMouseEvents == false) {
					mStage.mouseX = p.X;
					mStage.mouseY = p.Y;
					var me = new flash.events.MouseEvent(flash.events.MouseEvent.MOUSE_DOWN, true, false, p.X, p.Y, mStage);
					mStage.dispatchEvent (me);
				}
			}
		}
示例#14
0
        public override void TouchesMoved(NSSet touches, UIEvent evt)
        {
            base.TouchesMoved (touches, evt);

            foreach (UITouch touch in touches) {
                var p = touch.LocationInView(this);
                Console.WriteLine ("touches-moved {0}", p);

                var te = new flash.events.TouchEvent(flash.events.TouchEvent.TOUCH_MOVE, true, false, 0, true, p.X, p.Y, 1.0, 1.0, 1.0 );
                if (mStage!=null) mStage.dispatchEvent (te);
            }
        }
示例#15
0
		public void OnTouchesEnded (NSSet touches, UIEvent evt)
		{
			foreach (UITouch touch in touches) {
				var p = touch.LocationInView(touch.View);
				//Console.WriteLine ("touches-ended {0}", p);

				mStage.mouseX = p.X;
				mStage.mouseY = p.Y;

				var te = new flash.events.TouchEvent(flash.events.TouchEvent.TOUCH_END, true, false, 0, true, p.X, p.Y, 1.0, 1.0, 1.0 );
				mStage.dispatchEvent (te);

				var me = new flash.events.MouseEvent(flash.events.MouseEvent.MOUSE_UP, true, false, p.X, p.Y, mStage);
				mStage.dispatchEvent (me);

			}
		}