mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-20 23:52:40 +08:00
V3.5.0 Distribute touch events independently (#10712)
* Distribute touch events independently * remove touch event cast * Fix the error of clang-tidy Co-authored-by: qiuguohua <862332094@qq.com>
This commit is contained in:
@@ -113,6 +113,9 @@ int32_t Engine::init() {
|
||||
platform->setHandleEventCallback(
|
||||
std::bind(&Engine::handleEvent, this, std::placeholders::_1)); // NOLINT(modernize-avoid-bind)
|
||||
|
||||
platform->setHandleTouchEventCallback(
|
||||
std::bind(&Engine::handleTouchEvent, this, std::placeholders::_1)); // NOLINT(modernize-avoid-bind)
|
||||
|
||||
se::ScriptEngine::getInstance()->addRegisterCallback(setCanvasCallback);
|
||||
return 0;
|
||||
}
|
||||
@@ -284,6 +287,11 @@ bool Engine::handleEvent(const OSEvent& ev) {
|
||||
return isHandled;
|
||||
}
|
||||
|
||||
bool Engine::handleTouchEvent(const TouchEvent& ev) { // NOLINT(readability-convert-member-functions-to-static)
|
||||
cc::EventDispatcher::dispatchTouchEvent(ev);
|
||||
return true;
|
||||
}
|
||||
|
||||
Engine::SchedulerPtr Engine::getScheduler() const {
|
||||
return _scheduler;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user