| 863 | } |
| 864 | |
| 865 | bool 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 | |
| 885 | bool ControllerAgent::handle_shell(const ShellParam& param) |
| 886 | { |
nothing calls this directly
no test coverage detected