void TouchEventForm::OnTouchReleased(const Control &source, const Point ¤tPosition, const TouchEventInfo &touchInfo) { AppLog("OnTouchReleased is called. [%d]%d,%d", touchInfo.GetPointId(), currentPosition.x, currentPosition.y); DisplayMultipointTouchInfo(source); if(__clicked == true && __moved == false && __doubleClicked == false && __longPressed == false) { __singleClicked = true; char c[5]; int i; c[0]=2; c[1]=2; c[2]=1; c[3]=2; c[4]=0; __sock->Send((void *)c,5,i); } if(__doubleClicked == true && __moved == false) { char c[5]; int i; c[0]=2; c[1]=2; c[2]=1; c[3]=2; c[4]=0; __sock->Send((void *)c,5,i); } }
void TouchEventForm::OnTouchDoublePressed(const Control &source, const Point ¤tPosition, const TouchEventInfo &touchInfo) { AppLog("OnTouchDoublePressed is called. [%d]%d,%d", touchInfo.GetPointId(), currentPosition.x, currentPosition.y); DisplayMultipointTouchInfo(source); //__sock->Send((void *)c,5,i); __doubleClicked = true; __singleClicked = false; }
void TouchEventForm::OnTouchPressed(const Control &source, const Point ¤tPosition, const TouchEventInfo &touchInfo) { AppLog("OnTouchPressed is called. [%d]%d,%d", touchInfo.GetPointId(), currentPosition.x, currentPosition.y); DisplayMultipointTouchInfo(source); __x=currentPosition.x; __y=currentPosition.y; __clicked = true; __moved = false; __doubleClicked = false; __longPressed = false; }
void CCEGLView::OnTouchReleased(const Control& source, const Point& currentPosition, const TouchEventInfo & touchInfo) { int id = (int)touchInfo.GetPointId(); float x = (float)touchInfo.GetCurrentPosition().x; float y = (float)touchInfo.GetCurrentPosition().y; if (!m_bNotHVGA) { x = x * 2 / 3; y = y * 2 / 3; } onTouchesEnd(&id, &x, &y, 1); CCLOG("OnTouchReleased id = %d,x = %f,y = %f", id, x, y); }
void CCEGLView::OnTouchPressed(const Control& source, const Point& currentPosition, const TouchEventInfo & touchInfo) { int id = (int)touchInfo.GetPointId(); float x = (float)touchInfo.GetCurrentPosition().x; float y = (float)touchInfo.GetCurrentPosition().y; CCLOG("OnTouchPressed id = %d,x = %f,y = %f, count = %d", id, x, y, s_mapTouches.GetCount()); if (!m_bNotHVGA) { x = x * 2 / 3; y = y * 2 / 3; } onTouchesBegin(&id, &x, &y, 1); }
void TouchEventForm::OnTouchMoved(const Control &source, const Point ¤tPosition, const TouchEventInfo &touchInfo) { AppLog("OnTouchMoved is called. [%d]%d,%d", touchInfo.GetPointId(), currentPosition.x, currentPosition.y); DisplayMultipointTouchInfo(source); if(__doubleClicked == true) { char c[5]; c[0]=2; c[1]=2; c[2]=1; c[3]=(__release)?1:0; c[4]=0; int i; __sock->Send((void *)c,5,i); if(__release) { __pButton1->SetText(String("Mouse Press")); } else { __pButton1->SetText(String("Mouse Release")); } Draw(); Show(); __release = (__release)?false:true; __doubleClicked = false; } /*static long long lastTime=0; long long presentTime; Osp::System::SystemTime::GetTicks(presentTime); long limit = presentTime - lastTime; AppLog("Time diff : %ld",limit); if(limit >=20 ){ limit=1; } else if(limit < 16) { limit = 6; }else if(limit <17) { limit =5; }else if(limit <20) { limit =1; } AppLog("Limit Value : %ld",limit); //for(int j=0;j<3;j++) {*/ char c[5]; int i; c[0]=1; c[1]=2; c[2]=__x-currentPosition.x; c[3]=__y-currentPosition.y; c[4]=0; for(int j=0;j<3;j++) __sock->Send((void *)c,5,i); //} __x=currentPosition.x; __y=currentPosition.y; __moved = true; /*Osp::System::SystemTime::GetTicks(presentTime); lastTime = presentTime;*/ __singleClicked = false; }
void TouchEventForm::OnTouchFocusOut(const Control &source, const Point ¤tPosition, const TouchEventInfo &touchInfo) { AppLog("OnTouchFocusOut is called. [%d]%d,%d", touchInfo.GetPointId(), currentPosition.x, currentPosition.y); DisplayMultipointTouchInfo(source); }