MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / clickAt

Function clickAt

cpp/webdriver-interactions/interactions_linux_mouse.cpp:248–276  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

246extern "C"
247{
248WD_RESULT clickAt(WINDOW_HANDLE windowHandle, long x, long y, long button)
249{
250 init_logging();
251
252 LOG(DEBUG) << "---------- starting clickAt: " << windowHandle << "---------";
253 GdkDrawable* hwnd = (GdkDrawable*) windowHandle;
254
255 if (button == 2) {
256 // the right mouse button has the value 3 in GDK
257 button = 3;
258 } else {
259 // the left mouse button is default
260 button = 1;
261 }
262
263 MouseEventsHandler mousep_handler(hwnd);
264
265 list<GdkEvent*> events_for_mouse = mousep_handler.CreateEventsForMouseClick(x, y, button);
266 const int timePerEvent = 10 /* ms */;
267 submit_and_free_events_list(events_for_mouse, timePerEvent);
268
269
270 if (gLatestEventTime < mousep_handler.get_last_event_time()) {
271 gLatestEventTime = mousep_handler.get_last_event_time();
272 }
273
274 LOG(DEBUG) << "---------- Ending clickAt ----------";
275 return 0;
276}
277
278WD_RESULT doubleClickAt(WINDOW_HANDLE windowHandle, long x, long y)
279{

Callers

nothing calls this directly

Calls 5

init_loggingFunction · 0.85
LOGClass · 0.70
get_last_event_timeMethod · 0.45

Tested by

no test coverage detected