MCPcopy Create free account
hub / github.com/MaaXYZ/MaaFramework / handle_scroll

Method handle_scroll

source/MaaFramework/Controller/ControllerAgent.cpp:865–883  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

863}
864
865bool ControllerAgent::handle_scroll(const ScrollParam& param)
866{
867 if (!control_unit_) {
868 LogError << "control_unit_ is nullptr";
869 return false;
870 }
871
872 cv::Point point = preproc_touch_point(param.point);
873 if (!control_unit_->touch_move(0, point.x, point.y, 0)) {
874 LogWarn << "Failed to move to scroll position" << VAR(point);
875 }
876
877 if (auto unit = std::dynamic_pointer_cast<MAA_CTRL_UNIT_NS::ScrollableUnit>(control_unit_)) {
878 return unit->scroll(param.dx, param.dy);
879 }
880
881 LogError << "Scroll is not supported for this controller type";
882 return false;
883}
884
885bool ControllerAgent::handle_shell(const ShellParam& param)
886{

Callers

nothing calls this directly

Calls 2

touch_moveMethod · 0.65
scrollMethod · 0.65

Tested by

no test coverage detected