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

Method click

source/MaaKWinControlUnit/Input/UInputController.cpp:73–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71}
72
73bool UInputController::click(int x, int y)
74{
75 LogDebug << VAR(x) << VAR(y);
76
77 std::unique_lock<std::mutex> lock(mutex_);
78
79 if (!connected_) {
80 LogError << "Not connected";
81 return false;
82 }
83
84 if (!send_pointer_down(x, y)) {
85 LogError << "Failed to send pointer down";
86 return false;
87 }
88
89 // Small delay to simulate a real click
90 std::this_thread::sleep_for(std::chrono::milliseconds(50));
91
92 if (!send_pointer_up()) {
93 LogError << "Failed to send pointer up";
94 return false;
95 }
96
97 return true;
98}
99
100bool UInputController::swipe(int x1, int y1, int x2, int y2, int duration)
101{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected