MCPcopy Create free account
hub / github.com/WallBreaker2/op / MovePath

Method MovePath

libop/input/mouse/WinMouse.cpp:477–492  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

475}
476
477long 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
494long WinMouse::DragPath(const std::wstring &path_text, int duration) {
495 std::vector<POINT> key_points;

Callers

nothing calls this directly

Calls 5

parse_mouse_pathFunction · 0.85
expand_mouse_pathFunction · 0.85
delay_if_neededFunction · 0.85
run_mouse_pathFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected