private void display_CP7_screenReleased(Display_CP7 sender) { _tDown = false; if (!_cancelSwipe && _tt != TouchType.NoGesture) CalcForce(ptLast); if (ptLast.X > 800) { if (ptLast.Y >= 0 && ptLast.Y <= 50) TinkrCore.Instance.RaiseButtonReleased((int)TinkrCore.ButtonIDs.Up); else if (ptLast.Y >= 100 && ptLast.Y <= 150) TinkrCore.Instance.RaiseButtonReleased((int)TinkrCore.ButtonIDs.Select); else if (ptLast.Y >= 200 && ptLast.Y <= 250) TinkrCore.Instance.RaiseButtonReleased((int)TinkrCore.ButtonIDs.Down); } else TinkrCore.Instance.RaiseTouchEvent(TouchType.TouchUp, ptLast); }
private void SetupCP7(Display_CP7 CP7) { CP7.ScreenPressed += new Display_CP7.TouchEventHandler(display_CP7_ScreenPressed); CP7.screenReleased += new Display_CP7.TouchEventHandlerTouchReleased(display_CP7_screenReleased); CP7.gestureDetected += new Display_CP7.TouchGestureDetected(display_CP7_gestureDetected); CP7.homePressed += new Display_CP7.TouchEventHandlerHomeButton(display_CP7_homePressed); CP7.menuPressed += new Display_CP7.TouchEventHandlerMenuButton(display_CP7_menuPressed); CP7.backPressed += new Display_CP7.TouchEventHandlerBackButton(display_CP7_backPressed); }
private void display_CP7_ScreenPressed(Display_CP7 sender, Display_CP7.TouchStatus touchStatus) { ptLast = new Point(touchStatus.touchPos[0].xPos, touchStatus.touchPos[0].yPos); if (ptLast.X < 800) { if (!_tDown) { _tDown = true; _tt = TouchType.NoGesture; _cancelSwipe = false; _ptDownAt = ptLast; _lgDownAt = DateTime.Now.Ticks; TinkrCore.Instance.RaiseTouchEvent(TouchType.TouchDown, ptLast); } else { if (!_cancelSwipe) CalcDir(ptLast); TinkrCore.Instance.RaiseTouchEvent(TouchType.TouchMove, ptLast); } } }
private void display_CP7_menuPressed(Display_CP7 sender) { TinkrCore.Instance.RaiseButtonPressed((int)TinkrCore.ButtonIDs.Select); }
private void display_CP7_homePressed(Display_CP7 sender) { TinkrCore.Instance.RaiseButtonPressed((int)TinkrCore.ButtonIDs.Up); }
private void display_CP7_gestureDetected(Display_CP7 sender, Display_CP7.Gesture_ID id) { switch (id) { case Display_CP7.Gesture_ID.Move_Down: TinkrCore.Instance.RaiseTouchEvent(TouchType.GestureDown, ptLast); break; case Display_CP7.Gesture_ID.Move_Left: TinkrCore.Instance.RaiseTouchEvent(TouchType.GestureLeft, ptLast); break; case Display_CP7.Gesture_ID.Move_Right: TinkrCore.Instance.RaiseTouchEvent(TouchType.GestureRight, ptLast); break; case Display_CP7.Gesture_ID.Move_Up: TinkrCore.Instance.RaiseTouchEvent(TouchType.GestureUp, ptLast); break; case Display_CP7.Gesture_ID.No_Gesture: TinkrCore.Instance.RaiseTouchEvent(TouchType.NoGesture, ptLast); break; default: TinkrCore.Instance.RaiseTouchEvent((TouchType)id, ptLast); break; } }
private void display_CP7_backPressed(Display_CP7 sender) { TinkrCore.Instance.RaiseButtonPressed((int)TinkrCore.ButtonIDs.Down); }