private void OnGesureDetected(DisplayCP7 sender, DisplayCP7.GestureDetectedEventArgs e) { switch (e.Gesture) { case DisplayCP7.GestureType.MoveUp: GlideTouch.RaiseTouchGestureEvent(null, new TouchGestureEventArgs(TouchGesture.Up, this.last.X, this.last.Y, 0, DateTime.Now)); break; case DisplayCP7.GestureType.MoveLeft: GlideTouch.RaiseTouchGestureEvent(null, new TouchGestureEventArgs(TouchGesture.Left, this.last.X, this.last.Y, 0, DateTime.Now)); break; case DisplayCP7.GestureType.MoveDown: GlideTouch.RaiseTouchGestureEvent(null, new TouchGestureEventArgs(TouchGesture.Down, this.last.X, this.last.Y, 0, DateTime.Now)); break; case DisplayCP7.GestureType.MoveRight: GlideTouch.RaiseTouchGestureEvent(null, new TouchGestureEventArgs(TouchGesture.Right, this.last.X, this.last.Y, 0, DateTime.Now)); break; case DisplayCP7.GestureType.None: GlideTouch.RaiseTouchGestureEvent(null, new TouchGestureEventArgs(TouchGesture.NoGesture, this.last.X, this.last.Y, 0, DateTime.Now)); break; case DisplayCP7.GestureType.ZoomIn: case DisplayCP7.GestureType.ZoomOut: GlideTouch.RaiseTouchGestureEvent(null, new TouchGestureEventArgs(TouchGesture.Zoom, this.last.X, this.last.Y, 0, DateTime.Now)); break; } }
private void OnScreenPressed(DisplayCP7 sender, DisplayCP7.TouchEventArgs e) { if (e.TouchCount <= 0 || GlideTouch.IgnoreAllEvents) return; Point touch = new Point(e.TouchPoints[0].X, e.TouchPoints[0].Y); if (this.touched) { this.last.X = touch.X; this.last.Y = touch.Y; if (this.last.X != touch.X || this.last.Y != touch.Y) GlideTouch.RaiseTouchMoveEvent(null, new TouchEventArgs(touch)); } else { this.last.X = touch.X; this.last.Y = touch.Y; this.touched = true; GlideTouch.RaiseTouchDownEvent(null, new TouchEventArgs(touch)); } }
private void OnScreenReleased(DisplayCP7 sender, EventArgs e) { this.touched = false; GlideTouch.RaiseTouchUpEvent(null, new TouchEventArgs(this.last)); }