| 439 | } |
| 440 | |
| 441 | bool 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 | |
| 463 | bool ControllerAgent::handle_long_press(const LongPressParam& param) |
| 464 | { |
nothing calls this directly
no test coverage detected