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

Method handle_click

source/MaaFramework/Controller/ControllerAgent.cpp:441–461  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

439}
440
441bool ControllerAgent::handle_click(const ClickParam& param)
442{
443 if (!control_unit_) {
444 LogError << "control_unit_ is nullptr";
445 return false;
446 }
447
448 cv::Point point = preproc_touch_point(param.point);
449
450 bool ret = true;
451 if (control_unit_->get_features() & MaaControllerFeature_UseMouseDownAndUpInsteadOfClick) {
452 ret &= control_unit_->touch_down(param.contact, point.x, point.y, param.pressure);
453 std::this_thread::sleep_for(std::chrono::milliseconds(50));
454 ret &= control_unit_->touch_up(param.contact);
455 }
456 else {
457 ret &= control_unit_->click(point.x, point.y);
458 }
459
460 return ret;
461}
462
463bool ControllerAgent::handle_long_press(const LongPressParam& param)
464{

Callers

nothing calls this directly

Calls 4

get_featuresMethod · 0.65
touch_downMethod · 0.65
touch_upMethod · 0.65
clickMethod · 0.65

Tested by

no test coverage detected