void onTouchMotionEvent(s3ePointerTouchMotionEvent *evt) { if(evt->m_TouchID > NUMBER_OF_MULTI_TOUCHES) return; mMTStatus.PrevX[evt->m_TouchID] = mMTStatus.X[evt->m_TouchID]; mMTStatus.PrevY[evt->m_TouchID] = mMTStatus.Y[evt->m_TouchID]; mMTStatus.X[evt->m_TouchID] = evt->m_x; mMTStatus.Y[evt->m_TouchID] = evt->m_y; SEvent irrEvt; irrEvt.EventType = EET_MULTI_TOUCH_EVENT; irrEvt.MultitouchInput = mMTStatus; irrEvt.MultitouchInput.Event = EMTIE_MOVED; owner->postEventFromUser(irrEvt); // Publish fake event s3ePointerMotionEvent fakeEvt; for(int i = 0; i < NUMBER_OF_MULTI_TOUCHES; i++) { if(mMTStatus.Touched[i]) { mPosition.X = mMTStatus.X[i] + mOffset.X; mPosition.Y = mMTStatus.Y[i] + mOffset.Y; break; } } fakeEvt.m_x = mPosition.X; fakeEvt.m_y = mPosition.Y; onMotionEvent(&fakeEvt); }
JNIEXPORT void JNICALL Java_com_n0n3m4_q3e_Q3EJNI_sendMotionEvent(JNIEnv *env, jclass c, jfloat x, jfloat y) { onMotionEvent(x, y); }