DSLOG_ERR("DSTouch", "No touchFocus available.");
return;
}
+
+ if (ev->getType() == DSInputEvent::TouchDownEvent)
+ {
+ DSLOG_DBG("DSTouch", "[touchDown] devicename: %s, timestamp: %u\n",
+ ev->getDevice()->getName().c_str(), ev->getTimestamp());
+ touchDown(ev->getIndex(), ev->getX(), ev->getY());
+ }
+ else if (ev->getType() == DSInputEvent::TouchUpEvent)
+ {
+ DSLOG_DBG("DSTouch", "[touchDown] devicename: %s, timestamp: %u\n",
+ ev->getDevice()->getName().c_str(), ev->getTimestamp());
+ touchUp(ev->getIndex());
+ }
+ else//DSInputEvent::TouchMoveEvent
+ {
+ DSLOG_DBG("DSTouch", "[touchDown] devicename: %s, timestamp: %u\n",
+ ev->getDevice()->getName().c_str(), ev->getTimestamp());
+ touchMove(ev->getIndex(), ev->getX(), ev->getY());
+ }
+}
+
+void DSTouch::touchDown(int32_t id, int x, int y)
+{
+ if (__dswlTouch)
+ {
+ __dswlTouch->sendDown(id, x, y);
+ }
+}
+
+void DSTouch::touchUp(int32_t id)
+{
+ if (__dswlTouch)
+ {
+ __dswlTouch->sendUp(id);
+ }
+}
+
+void DSTouch::touchMove(int32_t id, int x, int y)
+{
+ if (__dswlTouch)
+ {
+ __dswlTouch->sendMotion(id, x, y);
+ }
}
void DSTouch::setFocus(std::shared_ptr<DSWindow> window)
virtual ~DSTouch();
void processEvent(DSInputTouchEvent *ev, void *data);
+ void touchDown(int32_t id, int x, int y);
+ void touchUp(int32_t id);
+ void touchMove(int32_t id, int x, int y);
void setFocus(std::shared_ptr<DSWindow> window);
std::shared_ptr<DSWindow> getFocus();