| 71 | } |
| 72 | |
| 73 | bool 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 | |
| 100 | bool UInputController::swipe(int x1, int y1, int x2, int y2, int duration) |
| 101 | { |
nothing calls this directly
no outgoing calls
no test coverage detected