| 475 | } |
| 476 | |
| 477 | long WinMouse::MovePath(const std::wstring &path_text, int duration) { |
| 478 | std::vector<POINT> key_points; |
| 479 | const int resolved_duration = resolve_trajectory_duration(duration); |
| 480 | if (resolved_duration < 0 || !parse_mouse_path(path_text, key_points)) |
| 481 | return 0; |
| 482 | |
| 483 | // MovePath 接收的是关键点,段内补点后再发送,避免长距离两点之间直接跳过去。 |
| 484 | const std::vector<POINT> path = expand_mouse_path(key_points); |
| 485 | if (path.size() < 2) |
| 486 | return 0; |
| 487 | delay_if_needed(_trajectory_start_delay); |
| 488 | const long ret = run_mouse_path(path, resolved_duration, [this](POINT pt) { return MoveTo(pt.x, pt.y); }); |
| 489 | if (ret) |
| 490 | delay_if_needed(_trajectory_end_delay); |
| 491 | return ret; |
| 492 | } |
| 493 | |
| 494 | long WinMouse::DragPath(const std::wstring &path_text, int duration) { |
| 495 | std::vector<POINT> key_points; |
nothing calls this directly
no test coverage detected